Please help with the following code, I tried casting, and the such but this keeps getting rounded

public void rotacion(Point[] pts, int degreesIncr)
        //here... I tried casting all combinations, even casted each variable, each 
        //number, and nothing, radians keeps being integral. but if I sustitute a 
        // constant number (e.g 80) radians is double, and I dont understand why. 
        //so silly this is.
        double radians =(degreesIncr)*(Math.PI / 180); 
        double sinAngle = Math.Sin(radians);
        double cosAngle = Math.Cos(radians);
        MessageBox.Show(radians.ToString() + "," + sinAngle.ToString() + "," + cosAngle.ToString());
        for (int i = 0; i < pts.Length; ++i)
            pts[i].X = (int)(pts[i].X * (cosAngle) - pts[i].Y * (sinAngle));
            pts[i].Y = (int)(pts[i].Y * (cosAngle) + pts[i].X * (sinAngle));
6 Years
Discussion Span
Last Post by namehere05

Oh, its working now, the problem was in the parameter, I was not passing the intended variable, I feel bad but I was desesperate, maybe next time Ill have some rest first and check the code later before posting, thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.