开发者

Direction vector perpendicular to two points

开发者 https://www.devze.com 2023-03-29 09:18 出处:网络
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?T

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

精彩评论

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