Checking if a Point is on a Line - Jay's Query

  • Context: High School 
  • Thread starter Thread starter inadaze
  • Start date Start date
  • Tags Tags
    Line Point
Click For Summary
SUMMARY

To determine if a third point (p3) lies on a line defined by two points (p1 and p2) on a Cartesian plane, compare the slopes. If the slope between p1 and p2 is equal to the slope between p1 and p3 (or p2 and p3), then p3 is on the line. This method is essential for game programming where user interaction involves drawing points on predefined lines.

PREREQUISITES
  • Understanding of Cartesian coordinates
  • Knowledge of slope calculation in geometry
  • Basic programming skills for implementing geometric checks
  • Familiarity with game development concepts
NEXT STEPS
  • Research slope calculation formulas in geometry
  • Explore collision detection techniques in game development
  • Learn about vector mathematics for game programming
  • Investigate user input handling for drawing points in games
USEFUL FOR

Game developers, programmers working with geometric algorithms, and anyone interested in implementing point-line intersection checks in interactive applications.

inadaze
Messages
20
Reaction score
0
Hey,
I was wondering:
If I had two points connected by a line on a cartesian plane(x and y for this) and i wanted to draw a third point, how could i tell if the third point was drawn somewhere on the line? I am programing a game where there is already a line drawn to connect to points and the user is supposed to draw a third point. i want to be able to check if it was drawn on the line or not.

Thanks
Jay
 
Mathematics news on Phys.org
Let p1 and p2 be the original two points, and p3 the third point. If the slopes between p1 and p2 is equal to that between p1 and p3 (or p2 and p3), then the three points lie on the same line.
 

Similar threads

  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K