Example #1
0
        public static Vector4 Normalize(Vector4 a)
        {
            float num = Vector4.Magnitude(a);

            if (num > 1E-05f)
            {
                return(a / num);
            }
            return(Vector4.zero);
        }
Example #2
0
        /// <summary>
        ///   <para></para>
        /// </summary>
        /// <param name="a"></param>
        public static Vector4 Normalize(Vector4 a)
        {
            float num = Vector4.Magnitude(a);

            if ((double)num > 9.99999974737875E-06)
            {
                return(a / num);
            }
            return(Vector4.zero);
        }
Example #3
0
        public void Normalize()
        {
            float num = Vector4.Magnitude(this);

            if (num > 1E-05f)
            {
                this /= num;
            }
            else
            {
                this = Vector4.zero;
            }
        }
Example #4
0
        /// <summary>
        ///   <para>Makes this vector have a magnitude of 1.</para>
        /// </summary>
        public void Normalize()
        {
            float num = Vector4.Magnitude(this);

            if ((double)num > 9.99999974737875E-06)
            {
                this = this / num;
            }
            else
            {
                this = Vector4.zero;
            }
        }
Example #5
0
        public static Vector4 Normalize(Vector4 a)
        {
            float   num = Vector4.Magnitude(a);
            Vector4 result;

            if (num > 1E-05f)
            {
                result = a / num;
            }
            else
            {
                result = Vector4.zero;
            }
            return(result);
        }
Example #6
0
 //
 // Static Methods
 //
 public static float Distance(Vector4 a, Vector4 b)
 {
     return(Vector4.Magnitude(a - b));
 }