Exemplo n.º 1
0
        private void TestMagnitude(Vector3 v1, Vector3 v2, DXVec3 dx1, DXVec3 dx2)
        {
            Magnitudes = new float[4];
            Magnitudes[0] = v1.Magnitude();
            Magnitudes[1] = v2.Magnitude();
            Magnitudes[2] = dx1.Length();
            Magnitudes[3] = dx2.Length();

            MagnitudesSq = new float[4];
            MagnitudesSq[0] = v1.MagnitudeS();
            MagnitudesSq[1] = v2.MagnitudeS();
            MagnitudesSq[2] = dx1.LengthSq();
            MagnitudesSq[3] = dx2.LengthSq();
        }
Exemplo n.º 2
0
 /// <summary>
 ///   <para>Returns the distance between a and b.</para>
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 public static double Distance(Vector3<double> a, Vector3<double> b)
 {
     Vector3<double> vec3 = new Vector3<double>(a.x - b.x, a.y - b.y, a.z - b.z);
     return vec3.Magnitude();
 }
Exemplo n.º 3
0
 /// <summary>
 ///   <para>Returns the distance between a and b.</para>
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 public static float Distance(Vector3<float> a, Vector3<float> b)
 {
     Vector3<float> vec3 = new Vector3<float>(a.x - b.x, a.y - b.y, a.z - b.z);
     return vec3.Magnitude();
 }
        public static void Test_Vector3_Generic_Magnitude_Against_Unity3D(float a, float b, float c)
        {
            //arrange
            Vector3<float> genericVec3One = new Vector3<float>(a, b, c);
            UnityEngine.Vector3 unityVec3One = new UnityEngine.Vector3(a, b, c);

            //assert
            Assert.AreEqual(genericVec3One.Magnitude(), unityVec3One.magnitude);
        }