Holds the three corners that define a triangle in 2D space.
View code on GitHub
Namespace: DeltaEngine.Rendering2D.ShapesAssembly: DeltaEngine.Rendering2D.Shapes (in DeltaEngine.Rendering2D.Shapes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Triangle2D type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Triangle2D(String) | Initializes a new instance of the Triangle2D class | |
Triangle2D(Vector2D, Vector2D, Vector2D) | Initializes a new instance of the Triangle2D class |
Methods
Name | Description | |
---|---|---|
Equals(Object) | (Overrides ValueType Equals(Object).) | |
Equals(Triangle2D) | ||
GetHashCode | (Overrides ValueType GetHashCode .) | |
ToString | (Overrides ValueType ToString .) |
Operators
Name | Description | |
---|---|---|
Equality | ||
Inequality |
Fields
Name | Description | |
---|---|---|
Corner1 | ||
Corner2 | ||
Corner3 | ||
SizeInBytes | ||
Zero |
Remarks
Examples
[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