Distance between a point and a line

BlitzMax Forums/BlitzMax Programming/Distance between a point and a line

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I need to find the distance from a point to a line.

using the math I found at
http://local.wasp.uwa.edu.au/~pbourke/geometry/pointline/

I came up with
distance = ( (Point.X - LineStart.X)*(LineEnd.X - LineStart.X) + (Point,Y - LineStart.Y)*(LineEnd.Y - LineStart.Y) ) / Sqr( (LineEnd.X-LineStart.X)*(LineEnd.X-LineStart.X) - (LineEnd.Y-LineStart.Y)*(LineEnd.Y-LineStart.Y) )


But all it gets me is the distance from the linestart. The math is making my head spin, does anyone have a function or non-broken equation for this?