Is a Point Inside a Triangle? Testing for Inclusion on a 2D Plane

Click For Summary

Discussion Overview

The discussion revolves around methods for determining whether a point is inside a triangle on a 2D plane. Participants explore various approaches, including geometric reasoning, linear algebra, and ray-casting techniques, without reaching a consensus on the best method.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant suggests checking if a point lies on the same side of the triangle's sides as the opposite vertex to determine inclusion.
  • Another participant proposes using linear combinations of vectors from triangle vertices to assess whether a point is inside the triangle.
  • A different approach involves casting a ray from the point and counting intersections with triangle planes, referencing Jordan's curve theorem.
  • One participant mentions calculating angles between vectors from the point to triangle corners, suggesting that a total of 360 degrees indicates the point is inside.
  • There is a request for clarification through visualization, indicating some participants seek a better understanding of the proposed methods.
  • Discussion includes conditions on the sums of parameters related to point inclusion, such as the requirement that certain values must be greater than 0 and not exceed 1.

Areas of Agreement / Disagreement

Participants express various methods and ideas, but no consensus is reached on a single approach for determining point inclusion within a triangle. Different viewpoints and techniques are presented, reflecting ongoing exploration and debate.

Contextual Notes

Some methods discussed depend on specific assumptions about the triangle's representation and the geometric properties involved, which may not be universally applicable.

eXt
Messages
4
Reaction score
0
Hi, how do I test if a point is inside a triangle? The point is assumed to be in the triangle's plane.
 
Mathematics news on Phys.org
How are you given the triangle? If you are given the lines that form the sides of the triangle and the vertices, determine if the point lies on the same side of the line as the opposite vertex.

For example, it the three sides of the triangle lie on x+ y= 4, x= 0, and y= 0. Then the three vertices (solving each pair of equations) are (0,0), (4,0) and (0,4). Is (3,2) inside the triangle? If we substitute the point (0,0) into x+ y= 4 we get 0+ 0= 0< 4 but if we substitute (3,2) we get 3+ 2= 5> 4. No, (3,2) is not on the same side of x+y= 4 as (0,0) and so cannot be inside the triangle.

Is (1,1) inside that triangle? 1+ 1= 2< 4 so (1,1) is on the same side of x+y= 4 as (0,0). The vertex "opposite" y= 0 is (0,4) which has y= 4> 0.
(1,1) has y= 1> 0 so (1,1) is on the same side of y=0 as (0,4). The vertex "opposite" x= 0 is (4, 0) which has x= 4> 0. (1,1) has x= 1> 0 so (1,1) is on the same side of x=0 as (4,0). Since (1,1) is on the same side of each line as the opposite vertex. Yes, (1,1) is inside the triangle.

This isn't really linear or abstract algebra so I am moving it to General Math.
 
Last edited by a moderator:
I think it could be mentioned as a linear algebra question. If the coordinates of 3 points are given... then you can give the coordinates of an arbitrary point in the plane using one of these points and a linear combination of the 2 vectors from this point to the other 2 points. Use this to determine whether the point is inside the triangle. What linear combinations occur for points inside the triangle?
 
What I'm trying to accomplish is to find if a point is within a geometric room consisting of several triangles. I am going to use Jordans curve theorem to find if it is so what I do is the following:
1) Cast a ray from the point (in an arbitrary direction) agains each plane the triangles are in.
2) If the ray intersects with the plane I calculate the point in the plane.
3) Now I need to figure out if this point is within the triangle or just in the plane.
4) And last, count each time the ray intersects with a triangle.

So, what I know about each triangle is it's 3 coordinates.

I've read about the following method but I'm not sure if its good or not:
Calculate a vector from the point to each corner of the triangle, if the sum of the angles between this vectors equals 360 degrees the point is inside.
 
eXt said:
What I'm trying to accomplish is to find if a point is within a geometric room consisting of several triangles. I am going to use Jordans curve theorem to find if it is so what I do is the following:
1) Cast a ray from the point (in an arbitrary direction) agains each plane the triangles are in.
2) If the ray intersects with the plane I calculate the point in the plane.
3) Now I need to figure out if this point is within the triangle or just in the plane.
4) And last, count each time the ray intersects with a triangle.

So, what I know about each triangle is it's 3 coordinates.

I've read about the following method but I'm not sure if its good or not:
Calculate a vector from the point to each corner of the triangle, if the sum of the angles between this vectors equals 360 degrees the point is inside.

What do you think of the method I posted?
 
I'm not exactly sure I understand it, could you draw a nice little image to visualize it?
 
The sum of a and b shoud not exceed 1?
 
Yes, and also they must both be greater than 0.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K