Finding the distance from a point to a line (using vectors)

preview_player
Показать описание


----------------------------------------
Big thanks to my Patrons for the full-marathon support!
Ben D, Grant S, Mark M, Phillippe S. Michael Z, Camille E.
Nolan C. Jan P. Devun C. Stefan C. Budoray Ethan BW

----------------------------------------
#blackpenredpen #math #calculus #apcalculus
Рекомендации по теме
Комментарии
Автор

I was very confused when I saw the thumbnail and saw a negative sign of the constant term, but I then noticed the equation, the constant is on the right hand side. Where I'm from, we use ax+by+c=0 rather than ax+by=c.

saathvikbogam
Автор

I've never used this formula in my math up to Calculus 2, the closest I've ever done is find the the least distence between a point and an equation using the derivative and distence formula of sqrt((x2-x1)²+(y2-y1)²) and then finding the minimum with Calculus

Asiago
Автор

In computer programming you can substitute the term

√ ( a² + b²)

into :

a/ sin ( atan( a / b))

Because square root is considered heavy computation.

If

ax+by+c=0 is the general equation of a straight line,

y= -ax/b

so, gradient m=-a/b

since m=y/x

then a = y, b=x

√ (a² + b²) is just hypotenuse to the triangle

|\
| \
| \
| \


Let angle t is in between the base of the triangle and hypotenuse.

Angle, t=atan (a/b)

To find hypotenuse,

H sin t = opposite

Since
a= the height of the triangle,

a is also opposite to the angle t.

H= a/sin t

Substitute t,

H= a/sin ( atan(a/b))

Thus,

√ (a²+b²) = a/sin ( atan(a/b))

abacaabaca
Автор

I have a more general proof: let's say you have a plane in R3 ax+by+cz+d=0 and a point (i, j, k). The shortest distant from point to the plane is the normal vector (a, b, c) from the point to the plane that is (i, j, k)+(a, b, c)t, substitute it in to ax+by+cz+d=0 and solve for t, you will get (ai+bj+ck+d)/(a^2+b^2+c^2). Then, the length of the vector is just when you multiply t and the magnitude of (a, b, c). You can also extent this to higher dimension

nekothecat
Автор

using coordinate transformations: left translation by c/a, followed by rotation matrix [[a, b]; [-b, a]]/(a^2+b^2). (both of these are isometries, of course) Then the line ax + by = c maps to the vertical line x = 0 (note that we transform equations via the inverse transformations on x and y, namely x -> x + c/a and (x, y) -> (ax + by, -bx + ay)/(a^2+b^2)), and (x1, y1) maps to (a*x1 + b*y1 - c, a*y1 - b*x1 + bc/a)/(a^2+b^2). So the distance is just the x-coordinate of the last point, (a*x1 + b*y1 - c)/(a^2+b^2).

johnchessant
Автор

Here is another way (assuming some other backround knowledge).
Instead of using the fact that <a, b> is normal to the line we will use the fact that <b, -a> points along the line. Then <b, -a> and the <x1-x0, y1-y0> form a parallelogram and we can look at <b, -a> as the base. The area of the parallelogram is given by the absolute value if the 2x2 determinant having these vectors as columns. The distance we want is just the height of the parallelogram so take the area divided by the length of the base.
Another way, embed the vectors in R3 by adding a 3rd component of 0 and use the cross product.

dmytryk
Автор

Interesting I didn't think about using a vector to prove this method. The only way I knew was to use the fact that the distance(line) between the point and the linear equation has a Perpendicular relation. And use the multiplication of two inclinations which has a Perpendicular relation is -1. ❤

jun-efco
Автор

Alternative method:

Let c1=ax1+by1, then ax+by=c1 is a line parallel to ax+by=c which passes through the point (x1, y1). The lines ax+by=c and ax+by=c1 intersects the x axis at x=-c/an and x=-c1/a respectively.

Construct the perpendicular segment from (-c/a, 0) to the line ax+by=c1, and call the acute angle either of the lines makes with the x axis p. Then |tan(p)|=|a/b| since it’s the absolute value of the slope, and The length of the perpendicular segment, which is also the distance from the point (x1, y1) to the line ax+by=c, is thus

divisix
Автор

You could do more geometry problems. Those are very useful in game programming.

For example: Given a 2D line and a 2D circle, find the intersection points between the line and the circle.

DjVortex-w
Автор

Thanks, because I was thinking about this formula and you did it.Fantastic!!!

aiml--aathir
Автор

An intuitive explanation:
The expression ax + by measures a magnitude along the vector (a, b), and that magnitude is a distance scaled by the length of (a, b). Plugging in an arbitrary point (x, y) gives you a measurement, let's call it 'd', which must be divided by |(a, b)| to be a true distance: d / |(a, b)|

The number 'c' in the equation ax + by = c is also such a measurement, so it must be divided by |(a, b)| to give a true distance as well: c / |(a, b)|

We therefore reduce the problem to one dimension by measuring along (a, b) and simply subtracting the measurements to find the difference between them. The distance between an arbitrary point and a point satisfying that equation must therefore be
|d - c| / |(a, b)|

APaleDot
Автор

If slope of a line ax^ 2 + bx + c = 0 is - a/ b then how to find a vector perpendicular to this line?

eusuf
Автор

Approximately 3.7632 for the question by Brilliant, my proof is finding the radius with the point P, (5). Then finding where the line y = -3x/4 + 7/4 intersects the graph of x^2 + y^2 = 25. Then using the positive intersection point as j hat and the negative intersection point as i hat. After that I put i hat and j hat into a 2x2 matrix then find that matrix’s determinant.

deveshkumardhayanidhi
Автор

Signed distance is cool. It can be thought as that the line ax+by+c=0 has two distinct sides (which can be swapped by negation of coefficents). So the sign of distance is the determinant of which side of line point resides in. It's very useful in computer graphics and so on.

MeandrLixy
Автор

Area(AOB) + Area(APB) = 24 m²; the radius of the circle is 5, and the line orthogonal to AB and also passing by P is y = 4/3 x;

RogerTannous
Автор

Solution to the last question
Area =1/2 * b * (h1+h2)
h1 = 7/5, h2 =18/5 (concept from this video)
r = 5
b/2 = 24/5 (Pythagoras theorem)
Which gives the area as 24 sq. units

himanshuuu
Автор

I don't get it. Why vector of V = <a, b>?

Can anyone help me? Thanks in advances.

Ben_Akademi
Автор

Wondering if you could help me out. If you have three known points in 3 space, how do you find a point closest to the three known points?

Ron_DeForest
Автор

Why exclude horizontal and vertical lines (a=0 and b=0)?
They have a distance to the point too.

theMagos
Автор

I remember doing this in my precalc class, my school's math classes are crazy haha

lumina_