How to Tell if a Point Lies on a Line (Segment)

  Рет қаралды 845

Edgar Programmator

Edgar Programmator

10 ай бұрын

In this video, I'll show you how to check if a point lies on a line in just 30 seconds. It's so easy, even a beginner can do it!
Line: y = mx + b
Point: (x0, y0)
Point is on line if: y0 = mx0 + b
Line: ax + by + c = 0
Point: (x0, y0)
Point is on line if: ax0 + by0 + c = 0
Line: (x2 - x1)(y - y1) = (y2 - y1)(x - x1)
Point: (x0, y0)
Point is on line if: (x2 - x1)(y0 - y1) = (y2 - y1)(x0 - x1)
Line segment: AB
Endpoints: A(x1, y1), B(x2, y2)
Point: C(x0, y0)
Point C is on line segment AB if: d(A, B) = d(A, C) + d(B, C)
Or if:
1. y0 ∈ [min(y1,y2), max(y1,y2)]
2. x0 ∈ [min(x1,x2), max(x1,x2)]
3. (x2 - x1)(y0 - y1) = (y2 - y1)(x0 - x1)
/ edgardocpu

Пікірлер: 3
@pmichaud
@pmichaud 6 ай бұрын
The test given in the video for a point being on a line segment doesn't work if the line is horizontal or vertical. For example, given a line segment of A(1,3.5) and B(3,3.5), the point C(2,3.5) is clearly on the line segment, but the equation (3.5
@EdgarProgrammator
@EdgarProgrammator 6 ай бұрын
You are right, try this conditional: if min(x1, x2)
@pmichaud
@pmichaud 6 ай бұрын
Yes, that works but I was hoping for something shorter and fewer overall comparisons. For now I'm using (x0-x1)*(x0-x2)
Find the Intersection of a Line and an Axis-Aligned Rectangle
2:00
Edgar Programmator
Рет қаралды 575
Find the Intersection of Two Line Segments in 2D (Easy Method)
2:39
Edgar Programmator
Рет қаралды 3,7 М.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 8 МЛН
🤔Какой Орган самый длинный ? #shorts
00:42
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 16 МЛН
Find the Line Passing Through the Middle of Two Points
2:01
Edgar Programmator
Рет қаралды 105
How to lie using visual proofs
18:49
3Blue1Brown
Рет қаралды 3,2 МЛН
A Surprisingly Easy Functional Equation 🤯🤯🤯
2:35
Mathemadix
Рет қаралды 7 М.
Dividing line segments according to ratio
3:57
Khan Academy
Рет қаралды 88 М.
How to find the equation of a line given two points
4:41
Brian McLogan
Рет қаралды 1,4 МЛН
The BEST Way to Find a Random Point in a Circle | #SoME1 #3b1b
18:35
Find the Intersection of Two Lines in the Plane: A Step-by-Step Guide
3:25
These Keys Shouldn't Exist | Nostalgia Nerd
19:32
Nostalgia Nerd
Рет қаралды 651 М.
How To Find The Slope of a Line | Algebra
10:11
The Organic Chemistry Tutor
Рет қаралды 260 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,8 МЛН
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 432 М.
Самые крутые школьные гаджеты
0:49