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

  • SEARCH
  • Home
  • 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

Related Questions

Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2)
How can I programmatically detect whether or not two triangles touch each other, given
How to draw a triangle using SlimDX's Direct2D interface given triangle vertices are given
I have 2 triangles and vertices p0, p1, p2, p3. These two triangle share
Given: A 3D mesh defined with a set of vertices and triangles building up
I'm trying to animate a triangle around a given point. I want the shape
Given a 3D point (x, y & z), and a triangle made of three
Given vertices V1 (x1,y1,z1) , V2 (x2,y2,z2) , V3 (x3,y3,z3) of a triangle T,
I have given the coordinates of 1000 triangles on a plane (triangle number (T0001-T1000)
I am trying to find circumcenter of Given Three point of Triangle…….. NOTE: all

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.