I'm trying math.sin and math.cos to do a moving edge line in my program. I get all the math and it seems to add up properly (I use mouse location from a click and a moving mouse variable to determine the draw areas. I then use a width value to give it the edge offset.
I use math.cos to find how far in to offset the points in the X and Y locations. While doing this, the value of cos(Angle) seems to go absolutely crazy, from +1 to -1. Here's an example.
Angle = 29.153788462442
Cos as per window calculator = 0.8733152733324487151754721490934
Cos as per Math.Cos(Angle) = -0.637571130025255
I tried converting Angle to a float and an int in case the decimal place was causing it an issue, no avail.
This is the code I am using to bring up those answers.
lblInOpts.Text = Math.Cos(Angle).ToString() + " " + Angle.ToString();
The document is in degrees, switched over from radians and being use the same way MSDN seems to suggest.