标准化:normalized
只考虑方向不考虑向量的大小时使用;
求向量长度
float fLenght = (v2.x * v2.x) + (v2.y* v2.y);
fLenght= Mathf.Sqrt(lenght);
点乘:求角度得到的值为标量
Mathf.Acos(Vector3.Dot(Vector1, Vector2))值为弧度;
弧度转角度:弧度*Mathf.Rad2Deg;
m_fAngle = Mathf.Acos(Vector3.Dot(v2ReferencePos.normalized, new Vector2(300, 0).normalized)) * Mathf.Rad2Deg;
叉乘:求方向值为矢量
求角度位置
Vector2 m_v2Pos = Quaternion.Euler(new Vector3(0, 0, -Angle)) * listUIObject[0].anchoredPosition;
运动时保持四元素信息
m_listUIObjectTransform[0].transform.rotation = m_qtReferenceQuaternion;