MathExtensions RadiansToDegrees Method Delta Engine Documentation

Namespace: DeltaEngine.Extensions
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public static float RadiansToDegrees(
	this float radians
)

Return Value

Type: Single

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Single. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Tests: DeltaEngine.Tests.Extensions.MathExtensionsTests
Examples

2 unit tests call DeltaEngine.Extensions.MathExtensions.RadiansToDegrees(System.Single)
[Test]
public void RadiansToDegrees()
{
    Assert.AreEqual(0.0f, MathExtensions.RadiansToDegrees(0));
    Assert.AreEqual(572.95776f, MathExtensions.RadiansToDegrees(10));
    Assert.AreEqual(0.0f, 0.0f.RadiansToDegrees());
    Assert.AreEqual(180.0f, MathExtensions.Pi.RadiansToDegrees());
    Assert.AreEqual(-360.0f, -2.0f * MathExtensions.Pi.RadiansToDegrees());
    Assert.AreEqual(1234.0f, 1234.0f.RadiansToDegrees().DegreesToRadians());
}
[Test]
public void DegreesToRadians()
{
    Assert.AreEqual(0.0f, MathExtensions.DegreesToRadians(0));
    Assert.AreEqual(MathExtensions.Pi, 180.0f.DegreesToRadians());
    Assert.AreEqual(-2.0f * MathExtensions.Pi, -360.0f.DegreesToRadians());
    Assert.AreEqual(1234.0f, 1234.0f.DegreesToRadians().RadiansToDegrees());
}
See Also