Exemple #1
0
        public static Vector2 DirectionFromAngle(float angle)
        {
            var x = (float)Math.Cos(DevMath.DegToRad(angle));
            var y = (float)Math.Sin(DevMath.DegToRad(angle));

            return(new Vector2(x, y));
        }
Exemple #2
0
 public static Vector2 DirectionFromAngle(float angle)
 {
     //float _x = (float)Math.Cos(angle);
     //float _y = (float)Math.Sin(angle);
     angle = DevMath.DegToRad(angle);
     return(new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)));
 }
Exemple #3
0
        public static Vector2 DirectionFromAngle(float angle)
        {
            // Cos en sin. Hier dan dus devmath gebruiken ipv math? sinds ik de DegToRad toch al heb geschreven
            int dX = (float)Math.Cos(DevMath.DegToRad(angle));
            int dY = (float)Math.Sin(DevMath.DegToRad(angle));

            return(new Vector2(dX, dY));
        }
        public static Vector2 DirectionFromAngle(float angle)
        {
            float radians = DevMath.DegToRad(angle);
            float newX    = (float)Math.Cos(radians);
            float newY    = (float)Math.Sin(radians);

            return(new Vector2(newX, newY));
        }
Exemple #5
0
        public static Vector2 DirectionFromAngle(float angle)
        {
            float x = 1f;
            float y = 0f;

            return(new Vector2(x * ( float )Math.Cos(DevMath.DegToRad(angle)) - y * ( float )Math.Sin(DevMath.DegToRad(angle)), x *
                               ( float )Math.Sin(DevMath.DegToRad(angle)) - y * ( float )Math.Cos(DevMath.DegToRad(angle))));
        }
Exemple #6
0
        public static Matrix4x4 RotateZ(float rotation)
        {
            Matrix4x4 mat = new Matrix4x4();

            float cos = (float)Math.Cos(DevMath.DegToRad(rotation));
            float sin = (float)Math.Sin(DevMath.DegToRad(rotation));

            mat.m[0][0] = cos;
            mat.m[0][1] = -sin;
            mat.m[1][0] = sin;
            mat.m[1][1] = cos;
            mat.m[2][2] = 1;
            mat.m[3][3] = 1;

            return mat;
        }
 public static Vector2 DirectionFromAngle(float angle)
 {
     return(new Vector2((float)Math.Cos(DevMath.DegToRad(angle)), (float)Math.Sin(DevMath.DegToRad(angle))));
     //throw new NotImplementedException();
 }
Exemple #8
0
        public static Vector2 DirectionFromAngle(float angle)
        {
            double rad = DevMath.DegToRad(angle);

            return(new Vector2((float)Math.Cos(rad), (float)Math.Sin(rad)));
        }
Exemple #9
0
 public static Vector2 DirectionFromAngle(float angle) //in radians
 {
     angle = DevMath.DegToRad(angle);
     return(new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)));
 }
Exemple #10
0
        public static Vector2 DirectionFromAngle(float angle)
        {
            float r_angle = DevMath.DegToRad(angle);

            return(new Vector2((float)Math.Cos(r_angle), (float)Math.Sin(r_angle)));
        }
Exemple #11
0
 public static Vector2 DirectionFromAngle(float angle)
 {
     //Insert degrees and get a vector2
     float a = DevMath.DegToRad(angle);
     return new Vector2((float)Math.Cos(a), (float)Math.Sin(a));
 }