当前位置:网站首页>D39_Vector
D39_Vector
2022-08-05 06:32:00 【Not so simple GG】
目录
1.Simple operations on vectors
6.Addition and subtraction of vectors
1.Simple operations on vectors
1.向量简介
向量:具有大小和方向的量 标量(矢量):只有大小没有方向的量
transform.position代表坐标 transform.forward代表向量
2.vector between two points
从起点A指向终点B的向量----用BThe coordinates of the point are subtractedA点的坐标
3.零向量
The zero vector is the only one of size 0的向量 Vector3.zero
4.负向量
If two vectors are equal in magnitude and opposite in direction, they are negative vectors of each other (x,y,z)的负向量为(-x,-y,-z)
-transform.forwardMeaning is directly behind the object -Vector3.forwardIt means right behind the world
5.向量的大小
|A|=(x²+y²+z²)½ 向量的模长 几何意义:The distance between two endpoints
定义A为向量 Unity中使用 A.magnitude Find the modulo length of a vector 平方模 A.sqrMagnitude
Using the square mode is more efficient than the mode length,Because it is easier for a computer to calculate a square than to take a square root
6.Addition and subtraction of vectors
A(x1,y1,z1)向量加B(x2,y2,z2)向量 |A|+|B|=(x1+x2,y1+y2,z1+z2)
A(x1,y1,z1)向量减B(x2,y2,z2)向量 |A|-|B|=(x1-x2,y1-y2,z1-z2)
7.Vector3 +- Vector3的几何意义
Vector3意义为 坐标 或者 向量
坐标+坐标 : 无意义
坐标+向量 : 得到新的位置----将一个点,in the direction of the vector,Modulo length of the motion vector,得到新的坐标点
向量+向量 : 得到一个新的向量----将BThe start point of the vector is translated toAThe end point of the vector,就会得到 从AThe starting point of the vector points toBThe end point of the vector of this new vector
坐标-坐标 : A-B 得到一个向量----得到一个从B指向A的向量
向量-向量 : 得到一个新的向量----Connect the origins of two vectors by translation,Connect the endpoints of two vectors,The direction points to the subtracted vector A-B相当于A+(-B)
位置-向量 : 得到新的位置----位置+(-向量) Place a point against the direction of the vector,The modulo length in the direction of movement,Get the coordinates of the new point
向量-位置 : 无意义
8.向量*标量
A(x,y,z)*M 得到 B(x*M,y*M,z*M)
得到一个新的向量 : Increase the modulo length of the vector by a multiple of the scalar,Scalar is a positive number,方向不变,Scalar is negative,方向相反
2.向量的乘法
1.向量的点乘
A(x1,y1,z1) B(x2,y2,z2) AB=x1*x2+y1*y2+z1*z2 What is obtained is a new value
几何意义:AB=|A|*|B|*cosθ
θ是A BThe vector is less than180°的夹角
cosθ=AB/|A|*|B|
θ=ArcCos(AB/|A|*|B|)
If the two vectors are unit vectors--------AB=cosθ -------- θ=ArcCos(AB)
By vector dot product,The angle between the two vectors can be obtained
It only makes sense to dot-multiply a vector,Position dot-multiply vector,Position multiplication by position is meaningless
2.向量的叉乘
A(x1,y1,z1) B(x2,y2,z2) A×B=(y1z2-z1y2,z1x2-x1z2,x1y2-y1x2)
几何意义:A叉乘BThe resulting new vector is also perpendicular to A B向量
A叉乘BThe resulting new vector is perpendicular to A Bformed plane
A叉乘B得到的就是A B face normal
Use the left-hand rule to determine direction,Four-finger wrapping direction from left multiplier to right multiplier,The thumb points in the direction of the cross
3.API
开根号:Mathf.Sqrt();
指数:Mathf.Pow();
向量的模: 向量.magnitude;
The square modulo of the vector:向量.sqrMagnitude;
反三角:Mathf.Acos(); Mathf.Asin();
绝对值:Mathf.Abs();
向量的归一化:向量.normalized;
向量点乘:Vector3.Dot();
算夹角:Vector3.Angle();
向量叉乘:Vector3.Cross();
弧度转角度:弧度* Mathf.Rad2Deg
角度转弧度:角度* Mathf.Deg2Red
边栏推荐
- Transformer详细解读与预测实例记录
- 用户和用户组管理、文件权限管理
- The hook of the operation of the selenium module
- NAT实验
- Native JS takes you to understand the implementation and use of array methods
- 系统基础-学习笔记(一些命令记录)
- 运维工程师,快来薅羊毛
- [Problem has been resolved]-Virtual machine error contains a file system with errors check forced
- King power volume LinkSLA, realize operations engineer is happy fishing
- 磁盘管理与文件系统
猜你喜欢

sql server 重复值在后面计数

系统基础-学习笔记(一些命令记录)

Take you in-depth understanding of cookies

spark operator - map vs mapPartitions operator

有哪些事情是你做了运维才知道的?

ALC experiment

Transport layer protocol (TCP 3-way handshake)

Problems encountered in installing Yolo3 target detection module in Autoware

Mina's long and short connections

运维工程师,快来薅羊毛
随机推荐
Difference between link and @improt
浏览器存储WebStorage
What's the point of monitoring the involution of the system?
time complexity and space complexity
千亿IT运维市场,产品要凭实力说话
Technology Sharing Miscellaneous Technologies
Unity realizes first-person roaming (nanny-level tutorial)
路由器和静态路由的配置
Detailed explanation of ten solutions across domains (summary)
正则表达式小示例--获取重复最多的字符及其数量
May I ask how to read the binlog of the two tables of hologres through flink sql, and then how to join?
618,你也许可以清醒亿点点
Will intelligent operation and maintenance replace manual operation and maintenance?
VRRP overview and experiment
spark source code - task submission process - 3-ApplicationMaster
Browser Storage WebStorage
多线程之传递参数
In-depth Zabbix user guide - from the green boy
5分钟完成mysql离线安装
input详解之文件上传