Direction of two points

前端 未结 2 504
傲寒
傲寒 2021-02-06 23:39

Some high school math concept has been forgotten, so I ask here.

If I have two points p1(x1,y1), p2(x2,y2), the direction is P1-->p2<

2条回答
  •  孤独总比滥情好
    2021-02-07 00:06

    • Answer 1: it is Vector(x2-x1,y2-y1)
    • Answer 2: Normalizing means to scale the vector so that its length is 1. It is a useful operation in many computations, for example, normal vectors should be specified normalized for lighting calculations in computer graphics. The normalized vector of v(x,y) is vn(x/Length(v), y/length(v)).

    HTH

提交回复
热议问题