Direction vector perpendicular to two points
I have two points in space:
(x,y) (x2,y2)
Using those points I want to draw an object perpendicular to them. How can I find the perpe开发者_开发问答ndicular direction vector with those two points?
The quickest would probably be:
(- (x2-x), y2-y)
This basically follows from the "Common Rotations" section on about rotation matrices. The negative of this vector is also perpendicular, it's up to you which one you want to use.
Can't you just flip the X and Y coordinates to find a line perpendicular?
精彩评论