两点方向 [英] Direction of two points

查看:85
本文介绍了两点方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些高中数学概念已被遗忘,所以我在这里问.

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

如果我有两个点p1(x1,y1)p2(x2,y2),则方向为P1-->p2,即p1指向p2.要用向量表示这个方向,是Vector(x2-x1,y2-y1)还是Vector(x1-x2, y1-y2)?

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?

推荐答案

  • 答案1:是Vector(x2-x1,y2-y1)
  • 答案2:归一化是指对矢量进行缩放,以使其长度为1.这在许多计算中都是有用的操作,例如,应指定法向矢量以对计算机图形中的照明计算进行归一化. v(x,y)的归一化向量是vn(x/Length(v), y/length(v)).
    • 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

      这篇关于两点方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆