Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Datatypes.Vector2DTests
2 unit tests call DeltaEngine.Datatypes.Vector2D.Normalize(DeltaEngine.Datatypes.Vector2D)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- vector
- Type: DeltaEngine.Datatypes Vector2D
Return Value
Type: Vector2DRemarks
Examples
[Test] public void Normalize() { var v = Vector2D.Normalize(new Vector2D(0.3f, -0.4f)); Assert.AreEqual(new Vector2D(0.6f, -0.8f), v); }
[Test] public void DotProduct() { var v3 = Vector2D.Normalize(new Vector2D(1, 1)); var v4 = Vector2D.Normalize(new Vector2D(-1, 1)); Assert.AreEqual(0.0f, v3.DotProduct(v4)); Assert.AreEqual(0.7071f, v3.DotProduct(Vector2D.UnitY), 0.0001f); }
See Also