Triangle2D StructureDelta Engine Documentation
Holds the three corners that define a triangle in 2D space. View code on GitHub

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

public struct Triangle2D

The Triangle2D type exposes the following members.

Constructors

  NameDescription
Public methodTriangle2D(String)
Initializes a new instance of the Triangle2D class
Public methodTriangle2D(Vector2D, Vector2D, Vector2D)
Initializes a new instance of the Triangle2D class
Top
Methods

  NameDescription
Public methodEquals(Object) (Overrides ValueType Equals(Object).)
Public methodEquals(Triangle2D)
Public methodGetHashCode (Overrides ValueType GetHashCode .)
Public methodToString (Overrides ValueType ToString .)
Top
Operators

  NameDescription
Public operatorStatic memberEquality
Public operatorStatic memberInequality
Top
Fields

  NameDescription
Public fieldCorner1
Public fieldCorner2
Public fieldCorner3
Public fieldStatic memberSizeInBytes
Public fieldStatic memberZero
Top
Remarks

Tests: DeltaEngine.Rendering2D.Shapes.Tests.Triangle2DTests
Examples

11 unit tests call DeltaEngine.Rendering2D.Shapes.Triangle2D
[Test]
public void DefaultConstructor()
{
    var triangle = new Triangle2D();
    Assert.AreEqual(Vector2D.Zero, triangle.Corner1);
    Assert.AreEqual(Vector2D.Zero, triangle.Corner2);
    Assert.AreEqual(Vector2D.Zero, triangle.Corner3);
    Assert.AreEqual(triangle, Triangle2D.Zero);
}
[Test]
public void SizeOfTriangle2D()
{
    Assert.AreEqual(24, Triangle2D.SizeInBytes);
}
[Test]
public void Constructor()
{
    var triangle = new Triangle2D(new Vector2D(1, 2), new Vector2D(3, 4), new Vector2D(5, 6));
    Assert.AreEqual(new Vector2D(1, 2), triangle.Corner1);
    Assert.AreEqual(new Vector2D(3, 4), triangle.Corner2);
    Assert.AreEqual(new Vector2D(5, 6), triangle.Corner3);
}
See Also