GraphLineTests AddThirdPointInTheMiddle Method Delta Engine Documentation

Namespace: DeltaEngine.Rendering2D.Graphs.Tests
Assembly: DeltaEngine.Rendering2D.Graphs.Tests (in DeltaEngine.Rendering2D.Graphs.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void AddThirdPointInTheMiddle()
Examples

[Test, CloseAfterFirstFrame]
public void AddThirdPointInTheMiddle()
{
    GraphLine line = CreateLineWithTwoPoints();
    line.AddPoint(new Vector2D(0.5f, 0.4f));
    Assert.AreEqual(3, line.points.Count);
    Assert.AreEqual(2, line.lines.Count);
    Line2D line0 = line.lines[0];
    Assert.IsTrue(line0.StartPoint.IsNearlyEqual(new Vector2D(0.462f, 0.5f)));
    Assert.IsTrue(line0.EndPoint.IsNearlyEqual(new Vector2D(0.5f, 0.519f)));
    Line2D line1 = line.lines[1];
    Assert.IsTrue(line1.StartPoint.IsNearlyEqual(new Vector2D(0.5f, 0.519f)));
    Assert.IsTrue(line1.EndPoint.IsNearlyEqual(new Vector2D(0.538f, 0.462f)));
}
See Also