开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜