예제 #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));
 }