两点的方向
有些高中数学概念忘记了,所以在这里问一下。
如果我有两个点p1(x1,y1)
, p2(x2,y2)
,方向是P1-->p2
,即 p1
指向 p2
。用向量来表示这个方向,是Vector(x2-x1,y2-y1)
还是Vector(x1-x2,y1-y2)
?
顺便问一下,向量归一化的目的是什么?
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
, that's p1
points to p2
. To represent this direction by vector, is it Vector(x2-x1,y2-y1)
or Vector(x1-x2, y1-y2)
?
By the way, what is the purpose to normalize a vector?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Vector(x2-x1,y2-y1)
v(x,y)
的归一化向量为vn(x/Length(v), y/length(v))
。华泰
Vector(x2-x1,y2-y1)
v(x,y)
isvn(x/Length(v), y/length(v))
.HTH
记住减法的一个好方法是考虑向量实际上做了什么。想象向量 v 位于 p1,指向并连接到 p2。这意味着 p1 + v = p2。因此,v = p2-p1。
A nice way to remember which way the subtraction goes is to think of what the vector actually does. Imagine vector v resting at p1, pointing and connecting to p2. This means that p1 + v = p2. Therefore, v = p2-p1.