MegaSack DRAW - This year's winner is user - rgwb
We will be in touch
Trying to derive the formula for distance from a line with the form ax+by+c=0 to a point (u,v).
I know the formula, don't need it. Trying to work out the way to get there.
I think I've found the right way, but it seems like I've got to do a LOT of algebra to get there, and it doesn't feel quite right (or I'm just lazy).
Is there a simple way to do this, or is it really long?
OK I think I got the gist of your problem and it's a nice one.
Yes, it sound like it'll take a few steps to get there. From the top of my head (bear in mind it's been a while since I did A-Level (gawd that's making me feel old)).
ax + by + c is a linear equation, find the gradient.
then you cna find the inverse of that, which is normal to your line.
the shortest distance from your point to the line is along that normal.
when that line crosses your point, it will intesect your original line.
find the distance from your point to your intersection using pythagoras.
QED.
Yeah, but I'm trying to derive the formula here.
The formula is (in this context)
|au+bv+c|/sqrt(a^2+b^2)
Well done JonT!
Do what JonT says and then juggle the algebra.
Simples *squeak*
Or.. wait a minute... can you not just write a formula for the distance to any point from your point, then constrain that with the formula for your line.. then differentiate it and solve....?
I could maybe have a look at that if I could be bothered and it hadn't been 15 years.
chapeau molgrips - you're a ****in maths genius.
My first thoughts were to do it the way JonT suggested but I couldn't be ar$ed with all the algebra.
If Manville is in the USofA then you are forgiven, if not its MATHS.
Sorry I was crap at algebra, but at least I can spell it 😀
chapeau molgrips - you're a ****in maths genius.
Did that work?!
Calculus is nasty there isn't it.. you've got X and Y.. but wait - you've got a formula for y based on x.. hmm.. making me want to get the pen and paper out now.
[/i]molgrips - Member
chapeau molgrips - you're a ****in maths genius.
Did that work?![i]
Nah .. still a Sh1t load of algebra.
As JonT said find the gradient and the x and y co-ordinates, then put them into
Y1-Y2=m(X1-X2)
M being the gradient
put the x and y co-ords into Y2 and X2 then put them all on the same side.
So that was a quick maths question, I can't wait until the complicated stuff comes. 😯
