예제 #1
0
 public bool Equals(Direction3D other)
 {
     return(Math.Sign(deltaX) == Math.Sign(other.deltaX) &&
            Math.Sign(deltaY) == Math.Sign(other.deltaY) &&
            Math.Sign(deltaZ) == Math.Sign(other.deltaZ) &&
            DeltaXY.Determinant(other.DeltaXY) == 0.0 &&
            DeltaXZ.Determinant(other.DeltaXZ) == 0.0 &&
            DeltaYZ.Determinant(other.DeltaYZ) == 0.0);
 }
예제 #2
0
        public double Dot(Direction3D rhs)
        {
            double dotProduct = this.deltaX * rhs.DeltaX + this.deltaY * rhs.DeltaY + this.deltaZ * rhs.DeltaZ;

            return(dotProduct);
        }
예제 #3
0
 public Direction3D Cross(Direction3D rhs)
 {
     return(new Direction3D(deltaY * rhs.deltaZ - deltaX * rhs.deltaY,
                            deltaX * rhs.deltaY - deltaX * rhs.deltaZ,
                            deltaX * rhs.deltaY - deltaY * rhs.deltaY));
 }