Thread: OT: 2D/3D math
View Single Post
  #8  
Old November 26th, 2004, 11:56 PM
Aiken's Avatar

Aiken Aiken is offline
Major
 
Join Date: Jan 2004
Location: Taganrog, Russia
Posts: 1,087
Thanks: 0
Thanked 0 Times in 0 Posts
Aiken is on a distinguished road
Default Re: OT: 2D/3D math

If P1(x1,y1) - startpoint
and P2(x2,y2) - endpoint
Then equation of the line will be:
x*(y2-y1) - y*(x2-x1) - x1*y2 + x2*y1 = 0

so A = y2-y1; B = -(x2-x1); C = -(x1*y2 - x2*y1).

But how to find coordinates of the point in the cross of line and perpendicular?
Reply With Quote