Vector2D RotationTo Method Delta Engine Documentation

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

public float RotationTo(
	Vector2D target
)

Return Value

Type: Single
Remarks

Tests: DeltaEngine.Tests.Datatypes.Vector2DTests
Examples

1 unit tests call DeltaEngine.Datatypes.Vector2D.RotationTo(DeltaEngine.Datatypes.Vector2D)
[Test]
public void RotationTo()
{
    var v = Vector2D.UnitX;
    var rotation = v.RotationTo(Vector2D.Zero);
    Assert.AreEqual(0, rotation);
    Assert.IsTrue(v.RotateAround(Vector2D.Zero, 90.0f).IsNearlyEqual(Vector2D.UnitY));
    rotation = Vector2D.UnitY.RotationTo(Vector2D.Zero);
    Assert.AreEqual(90, rotation);
}
See Also