Is C# working with degrees or radians?
When you use the Math library the Sin, Cos, ACos, etc methods work with radians but in graphics.DrawArc the startAngle and sweepAngle must be given in degrees.
It's not a big problem but it's a bit confusing to have to go passing between radians an degrees all the time.
PS Sorry, I know I have to improve my English
[354 byte] By [
JaimeOro] at [2007-12-22]
C# doesn't use either. The C# language has no built-in notion of angles. And since it doesn't have any native representation of an angle, it doesn't actually make sense to ask whether it works with degrees or radians.
Math.Cos, Math.Tan and so on are not part of C#. They are part of the .NET Framework Base Class Library. As such, they are language-neutral - the same functions are available to VB.NET, Python, Ruby, and any other language available for the .NET framework.
Likewise, Graphics.DrawArc is also part of the .NET Framework class libraries. (Technically speaking, I don't think they're part of the Base Class Library. The ECMA CLI specification defines the BCL as being a fairly small subset of the .NET Framework. So the System.Math class is in the FCL and the BCL, but System.Drawing.Graphics is only in the FCL. But I'm being pedantic...)
So I'll rephrase your question for you if you don't mind:
Do the .NET Framework Class Libraries work with degrees or radians?
And the answer is...both!
The methods in the System.Math class use radians. The types in System.Drawing (GDI+) seem to use degrees.
In short, the .NET Framework isn't terribly consistent here.