.NET Oddities #4

Comments 0

Share to social media

This is sheer genius:

System.Math.Sin( double a )
System.Math.Cos( double a )

…etc

all take an angle in radians as their argument. However:

System.Drawing.Drawing2D.Matrix.Rotate( float angle )
and System.Drawing.Drawing2D.Matrix.Rotate( float angle, MatrixOrder order )

both take the angle in degrees. Who on earth designed this?!??

Never mind, it’s not that important. I’m just going to take a few deep breaths, get my blood pressure down, and go and make a nice, soothing cup of tea instead… and then I’m going to submit this to thedailywtf.com. For the rest of you, just watch out for this little gotcha: things like this are the reason multi-million dollar space probes go missing.

Load comments

About the author

Bart is a project manager for Red Gate Software Ltd. He's currently looking after the .NET Reflector Pro project. Previously he's working on ANTS Memory Profiler, ANTS Performance Profiler, SQL Prompt, and has touched the code for most of the Red Gate SQL developer tools... some of them still haven't recovered from the shock. He was born and grew up in Dorset, was educated in Nottingham and London, and likes music and real ale. His photo is extremely misleading.

Bart Read's contributions