How to get the coordinates inside

  • Context: High School 
  • Thread starter Thread starter sarah22
  • Start date Start date
  • Tags Tags
    Coordinates
Click For Summary
SUMMARY

This discussion focuses on determining whether a point lies inside various geometric shapes, specifically a square, triangle, circle, and oval. The method involves using half-plane equations, where a triangle is defined by the intersection of three half-planes and a square by four. The formula for testing a point's position relative to a half-plane is given by the inequality xn_x + yn_y - d ≥ 0. For an ellipse, the condition is expressed as ax^2 + by^2 - c ≤ 0.

PREREQUISITES
  • Understanding of geometric shapes and their properties
  • Familiarity with half-plane equations
  • Knowledge of inequalities in mathematics
  • Basic algebra for manipulating equations
NEXT STEPS
  • Research the equations of half-planes for various geometric shapes
  • Study the application of inequalities in geometry
  • Learn about point-in-polygon algorithms
  • Explore the mathematical properties of ellipses and their equations
USEFUL FOR

Mathematicians, computer graphics developers, and anyone involved in geometric computations or algorithms for point location within shapes.

sarah22
Messages
26
Reaction score
0
What's the formula on how to get the coordinates inside of:
a) Square
b) Triangle
c) Circle
d) Oval

I tried the formula here, for triangle, (http://2000clicks.com/mathhelp/GeometryPointAndTriangle3.htm ) but sometimes even though the point is inside it says it is not.
 
Last edited by a moderator:
Physics news on Phys.org
A half-plane is given by an equation of the form xn_x+yn_y-d\ge 0 where (n_x,n_y) is the inward pointing normal vector of the boundary line, and d=p_xn_x+p_yn_y, where (p_x,p_y) is a point on the boundary.

To test if a point is inside the half-plane, you only need to check the above inequality.

Since a triangle (resp. a square) is the intersection of 3 (resp. 4) half-planes, you just need to figure out their equations and do the test for each one.

For an ellipse of the form ax^2+by^2-c=0, the corresponding inequality for the points inside it is ax^2+by^2-c\le 0.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K