Пример #1
0
 public Pos DirectionUnitVector(Pos To)
 {
     return((To - this).UnitVector);
 }
Пример #2
0
 public Pos DirectionVector(Pos To)
 {
     return(To - this);
 }
Пример #3
0
        /// <summary>
        /// 2次元方向ベクトルに対して左方向に向かう法線ベクトルを取得します
        /// </summary>
        /// <param name="To"></param>
        /// <returns></returns>
        public Pos NormalVector(Pos To)
        {
            Pos Direction = DirectionVector(To);

            return(new Pos(-Direction.y, Direction.x, 0));
        }
Пример #4
0
        public Pos NormalUnitVector(Pos To)
        {
            Pos Normal = NormalVector(To);

            return(Normal.UnitVector);
        }
Пример #5
0
 public static Pos CrossProduct(Pos A, Pos B)
 {
     return(new Pos(A.y * B.z - B.y * A.z, A.z * B.x - B.z * A.x, A.x * B.y - B.x * A.y));
 }