Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 739801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:26:32+00:00 2026-05-14T08:26:32+00:00

Given the triangle with vertices (a,b,c): c / \ / \ / \ a

  • 0

Given the triangle with vertices (a,b,c):

        c

      /   \

    /       \

  /           \

 a  -  -  -  -  b

Which is then subdivided into four triangles by halving each of the edges:

              c

            /    \

          /        \

     ca /            \ bc
           _   _   _
      /\              /\

    /    \          /    \

  /        \      /        \

a  -  -  -  - ab  -  -   -   -b

Which results in four triangles (a, ab, ca), (b, bc, ab), (c, ca, bc), (ab, bc, ca).

Now given a point p. How do I determine in which triangle p lies, given that p is within the outer triangle (a, b, c)?

Currently I intend to use ab as the origin. Check whether it is to the left of right of the line “ca – ab” using the perp of “ca – ab” and checking the sign against the dot product of “ab – a” and the perp vector and the vector “p – ab”. If it is the same or the dot product is zero then it must be in (a, ab, ca)… Continue with this procedure with the other outer triangles (b, ba, ab) & (c, ca, ba). In the end if it didn’t match with these it must be contained within the inner triangle (ab, bc, ca).

Is there a better way to do it?

EDIT

Here is a little more info of the intended application of the algorithm:

I’m using this as a subdivision mask to generate a fine mesh over which I intend to interpolate. Each of the triangles will be subdivided similarly up to a specified depth. I want to determine the triangle (at the maximum depth) within which the point p lies. With this I can evaluate a function at the point p using interpolation over the triangle. There is a class of triangles which is right-angled and they do comprise a significant portion, but they’re much easier to work with and this algorithm isn’t intended for them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:26:33+00:00Added an answer on May 14, 2026 at 8:26 am

    Triangles illustration

    • If the point is above ca/bc (i.e. in the top grey triangle) it’s easy.

    • If the point is left of ca (i.e. in the left grey triangle) it’s easy.

    • If the point is right of bc (i.e. in the right grey triangle) it’s easy.

    • If the point is in the middle, all you have to do is determine if the point is above or below the black V.

      You can do that by calulcating the y value of the line for the x value of the point and compare the result to the y value of the point.

      if (y' > (y * x') / x)
      {
          // center triangle
      }
      else
      {
          // right triangle
      }
      

    Is this the most efficient method? I don’t know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 516k
  • Answers 516k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Save each pc's log file under a different name in… May 16, 2026 at 6:47 pm
  • Editorial Team
    Editorial Team added an answer $90 is the assembler NOP instruction which does nothing on… May 16, 2026 at 6:47 pm
  • Editorial Team
    Editorial Team added an answer Your mistake is here. You're using the wrong variable name… May 16, 2026 at 6:47 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

How to draw a triangle using SlimDX's Direct2D interface given triangle vertices are given
Given: A 3D mesh defined with a set of vertices and triangles building up
Say I have a square from (0,0) to (z,z). Given a triangle within this
Given a triangle vertex defined with three 3D points, how do you calculate the
So, I'm starting a C++ class right now, and I've configured NetBeans (which I
I need to compute the area of the region of overlap between two triangles
So i have a set of four points in 3D Space. P1 [0, 0,
Given an XML layout like this, I'm trying to create a XSD schema to
Given an Entity Data Model (EDMX) with Code Generation Strategy set to None, how
I am building a CAD-file converter on top of two libraries (Opencascade and DWF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.