Ejemplo n.º 1
0
        public static Vector2f Rotate(Vector2f point, float radians)
        {
            float cosRadians = FlaiMath.Cos(radians * Mathf.Deg2Rad);
            float sinRadians = FlaiMath.Sin(radians * Mathf.Deg2Rad);

            return(new Vector2(
                       point.X * cosRadians - point.Y * sinRadians,
                       point.X * sinRadians + point.Y * cosRadians));
        }
Ejemplo n.º 2
0
        public static Vector2d Rotate(Vector2d point, double radians)
        {
            double cosRadians = FlaiMath.Cos(radians);
            double sinRadians = FlaiMath.Sin(radians);

            return(new Vector2d(
                       point.X * cosRadians - point.Y * sinRadians,
                       point.X * sinRadians + point.Y * cosRadians));
        }