Пример #1
0
        public Vec2 Normalized()
        {
            Vec2   vec2 = this;
            double num  = (double)vec2.Normalize();

            return(vec2);
        }
Пример #2
0
        public static Vec2 Slerp(Vec2 start, Vec2 end, float percent)
        {
            float  num1 = MBMath.ClampFloat(Vec2.DotProduct(start, end), -1f, 1f);
            float  num2 = (float)Math.Acos((double)num1) * percent;
            Vec2   vec2 = end - start * num1;
            double num3 = (double)vec2.Normalize();

            return(start * (float)Math.Cos((double)num2) + vec2 * (float)Math.Sin((double)num2));
        }