Example #1
0
 /// <summary>
 ///   Constructor.
 /// </summary>
 /// <param name="vector"> Initial vector. </param>
 public Vector3F(Vector3F vector)
 {
     this.X = vector.X;
     this.Y = vector.Y;
     this.Z = vector.Z;
 }
Example #2
0
 /// <summary>
 ///   Calculates the square distance between this and the passed vector.
 /// </summary>
 /// <param name="vector"> Vector to compute square distance to. </param>
 /// <returns> Square distance between this and the passed vector. </returns>
 public float GetSquareDistance(Vector3F vector)
 {
     return MathUtils.Pow2(vector.X - this.X) + MathUtils.Pow2(vector.Y - this.Y)
            + MathUtils.Pow2(vector.Z - this.Z);
 }
Example #3
0
 /// <summary>
 ///   Returns a vector that is made from the smallest components of two vectors.
 /// </summary>
 /// <param name="lhs"> First vector. </param>
 /// <param name="rhs"> Second vector. </param>
 /// <returns>Vector that is made from the smallest components of two vectors.</returns>
 public static Vector3F Min(Vector3F lhs, Vector3F rhs)
 {
     return new Vector3F(MathUtils.Min(lhs.X, rhs.X), MathUtils.Min(lhs.Y, rhs.Y), MathUtils.Min(lhs.Z, rhs.Z));
 }
Example #4
0
 /// <summary>
 ///   Determines whether the specified <see cref="Vector3F" /> is equal to the current <see cref="Vector3F" />.
 /// </summary>
 /// <returns>
 ///   true if the specified <see cref="Vector3F" /> is equal to the current <see cref="Vector3F" />; otherwise, false.
 /// </returns>
 /// <param name="other">
 ///   The <see cref="Vector3F" /> to compare with the current <see cref="Vector3F" />.
 /// </param>
 public bool Equals(Vector3F other)
 {
     return this.X.Equals(other.X) && this.Y.Equals(other.Y) && this.Z.Equals(other.Z);
 }
Example #5
0
 /// <summary>
 ///   Calculates the distance between this and the passed vector.
 /// </summary>
 /// <param name="vector"> Vector to compute distance to. </param>
 /// <returns> Distance between this and the passed vector. </returns>
 public float GetDistance(Vector3F vector)
 {
     return MathUtils.Sqrt(this.GetSquareDistance(vector));
 }
Example #6
0
 /// <summary>
 ///   Calculates the dot product of this and the passed vector. See http://en.wikipedia.org/wiki/Dot_product for more
 ///   details.
 /// </summary>
 /// <param name="vector"> Vector to calculate dot product with. </param>
 /// <returns> Dot product of this and the passed vector. </returns>
 public float CalculateDotProduct(Vector3F vector)
 {
     return Dot(this, vector);
 }
Example #7
0
 /// <summary>
 ///   Calculates the dot product of the two passed vectors. See http://en.wikipedia.org/wiki/Dot_product for more details.
 /// </summary>
 /// <param name="a"> First vector. </param>
 /// <param name="b"> Second vector. </param>
 /// <returns> Dot product of the two passed vectors. </returns>
 public static float Dot(Vector3F a, Vector3F b)
 {
     return (a.X * b.X) + (a.Y * b.Y) + (a.Z * b.Z);
 }
Example #8
0
 /// <summary>
 ///   Returns a vector that is made from the smallest components of two vectors.
 /// </summary>
 /// <param name="lhs"> First vector. </param>
 /// <param name="rhs"> Second vector. </param>
 /// <returns>Vector that is made from the smallest components of two vectors.</returns>
 public static Vector3F Min(Vector3F lhs, Vector3F rhs)
 {
     return(new Vector3F(MathUtils.Min(lhs.X, rhs.X), MathUtils.Min(lhs.Y, rhs.Y), MathUtils.Min(lhs.Z, rhs.Z)));
 }
Example #9
0
 /// <summary>
 ///   Constructor.
 /// </summary>
 /// <param name="vector"> Initial vector. </param>
 public Vector3F(Vector3F vector)
 {
     this.X = vector.X;
     this.Y = vector.Y;
     this.Z = vector.Z;
 }
Example #10
0
 /// <summary>
 ///   Calculates the square distance between this and the passed vector.
 /// </summary>
 /// <param name="vector"> Vector to compute square distance to. </param>
 /// <returns> Square distance between this and the passed vector. </returns>
 public float GetSquareDistance(Vector3F vector)
 {
     return(MathUtils.Pow2(vector.X - this.X) + MathUtils.Pow2(vector.Y - this.Y)
            + MathUtils.Pow2(vector.Z - this.Z));
 }
Example #11
0
 /// <summary>
 ///   Calculates the distance between this and the passed vector.
 /// </summary>
 /// <param name="vector"> Vector to compute distance to. </param>
 /// <returns> Distance between this and the passed vector. </returns>
 public float GetDistance(Vector3F vector)
 {
     return(MathUtils.Sqrt(this.GetSquareDistance(vector)));
 }
Example #12
0
 /// <summary>
 ///   Determines whether the specified <see cref="Vector3F" /> is equal to the current <see cref="Vector3F" />.
 /// </summary>
 /// <returns>
 ///   true if the specified <see cref="Vector3F" /> is equal to the current <see cref="Vector3F" />; otherwise, false.
 /// </returns>
 /// <param name="other">
 ///   The <see cref="Vector3F" /> to compare with the current <see cref="Vector3F" />.
 /// </param>
 public bool Equals(Vector3F other)
 {
     return(this.X.Equals(other.X) && this.Y.Equals(other.Y) && this.Z.Equals(other.Z));
 }
Example #13
0
 /// <summary>
 ///   Calculates the dot product of the two passed vectors. See http://en.wikipedia.org/wiki/Dot_product for more details.
 /// </summary>
 /// <param name="a"> First vector. </param>
 /// <param name="b"> Second vector. </param>
 /// <returns> Dot product of the two passed vectors. </returns>
 public static float Dot(Vector3F a, Vector3F b)
 {
     return((a.X * b.X) + (a.Y * b.Y) + (a.Z * b.Z));
 }
Example #14
0
 /// <summary>
 ///   Calculates the dot product of this and the passed vector. See http://en.wikipedia.org/wiki/Dot_product for more
 ///   details.
 /// </summary>
 /// <param name="vector"> Vector to calculate dot product with. </param>
 /// <returns> Dot product of this and the passed vector. </returns>
 public float CalculateDotProduct(Vector3F vector)
 {
     return(Dot(this, vector));
 }