示例#1
0
        /// <summary>
        /// Computes the cross product of two vectors, producing a new vector which
        /// is orthogonal to the two original vectors.
        /// </summary>
        /// <param name="start">The start vector.</param>
        /// <param name="end">The end vector.</param>
        /// <returns>The cross product of the two vectors.</returns>
        public static Vector3s Cross(Vector3s start, Vector3s end)
        {
            short x = (short)(start.Y * end.Z - end.Y * start.Z);
            short y = (short)((start.X * end.Z - end.X * start.Z) * -1);
            short z = (short)(start.X * end.Y - end.X * start.Y);

            var rtnvector = new Vector3s(x, y, z);

            return(rtnvector);
        }
示例#2
0
        /// <summary>
        /// Computes the cross product of two vectors, producing a new vector which
        /// is orthogonal to the two original vectors.
        /// </summary>
        /// <param name="start">The start vector.</param>
        /// <param name="end">The end vector.</param>
        /// <returns>The cross product of the two vectors.</returns>
        public static Vector3s Cross(Vector3s start, Vector3s end)
        {
            var x = (short)((start.Y * end.Z) - (end.Y * start.Z));
            var y = (short)(((start.X * end.Z) - (end.X * start.Z)) * -1);
            var z = (short)((start.X * end.Y) - (end.X * start.Y));

            var rtnvector = new Vector3s(x, y, z);

            return(rtnvector);
        }
示例#3
0
 /// <summary>
 /// Computes the dot product of two vectors.
 /// </summary>
 /// <param name="start">The start vector.</param>
 /// <param name="end">The end vector.</param>
 /// <returns>The dot product of the two vectors.</returns>
 public static short Dot(Vector3s start, Vector3s end)
 {
     return((short)((start.X * end.X) + (start.Y * end.Y) + (start.Z * end.Z)));
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShortBox"/> struct from a top and bottom corner.
 /// </summary>
 /// <param name="inBottomCorner">The bottom corner of the box.</param>
 /// <param name="inTopCorner">The top corner of the box.</param>
 /// <returns>A new <see cref="Box"/> object.</returns>
 public ShortBox(Vector3s inBottomCorner, Vector3s inTopCorner)
 {
     BottomCorner = inBottomCorner;
     TopCorner    = inTopCorner;
 }
示例#5
0
 /// <summary>
 /// Creates a new <see cref="Box"/> object from a top and bottom corner.
 /// </summary>
 /// <param name="inBottomCorner">The bottom corner of the box.</param>
 /// <param name="inTopCorner">The top corner of the box.</param>
 /// <returns>A new <see cref="Box"/> object.</returns>
 public ShortBox(Vector3s inBottomCorner, Vector3s inTopCorner)
 {
     this.BottomCorner = inBottomCorner;
     this.TopCorner    = inTopCorner;
 }