Пример #1
0
 public Vector3D(Vector3D v)
     : base(v)
 {
 }
Пример #2
0
 /// <summary>
 /// Returns a normalized vector perpendicular to this vector. Equivalent to rotating this vector 90 degrees clockwise.
 /// </summary>
 /// <returns>A normalized vector perpendicular to this vector.</returns>
 public Vector3D UnitNormal(Vector3D vector)
 {
     return this.Normal(vector).Normalize();;
 }
Пример #3
0
 /// <summary>
 /// Returns the cross product of two vectors. The cross product of the 3 3D vectors a and b is defined
 /// </summary>
 /// <param name="a">The first vector.</param>
 /// <param name="b">The second vector.</param>
 /// <returns>The cross product of <paramref name="a"/> and <paramref name="b"/>.</returns>
 public static Vector3D Cross(Vector3D a, Vector3D b)
 {
     return a.Normal(b);
 }
Пример #4
0
        /// <summary>
        /// Returns a vector perpendicular to this vector. 
        /// </summary>
        /// <returns>A vector perpendicular to this vector.</returns>
        public Vector3D Normal(Vector3D vector)
        {
            if (vector == this)
            {
                throw (new ArgumentException());
            }

            double x = this.Y * vector.Z - this.Z * vector.Y;
            double y = this.Z * vector.X - this.X * vector.Z;
            double z = this.X * vector.Y - this.Y * vector.X;

            return new Vector3D(x,y,z);
        }
Пример #5
0
 public Matrix3D(Vector3D a, Vector3D b, Vector3D c)
     : base(new Vector[]{(Vector)a, (Vector)b, (Vector)c})
 {
 }