org.starhope.appius.geometry
Class Triangle

java.lang.Object
  extended by org.starhope.appius.geometry.Triangle

public class Triangle
extends Object

A triangle

Author:
brpocock@star-hope.org

Field Summary
private  Coord3D[] points
          Vertices
 
Constructor Summary
Triangle(Coord2D[] newPoints)
          Create a planar triangle with the given vertices
Triangle(Coord3D[] newPoints)
          Create a triangle with the given vertices
 
Method Summary
 Collection<LineSeg3D> getEdges()
          Get the edges of this triangle
 Collection<Coord3D> getVertices()
          Get the vertices of the triangle
 Coord3D[] getVerticesArray()
          Get the vertices of the triangle as an array
 boolean hasEdge(LineSeg3D edge)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

points

private final Coord3D[] points
Vertices

Constructor Detail

Triangle

public Triangle(Coord2D[] newPoints)
Create a planar triangle with the given vertices

Parameters:
newPoints - the vertices

Triangle

public Triangle(Coord3D[] newPoints)
Create a triangle with the given vertices

Parameters:
newPoints - vertices
Method Detail

getEdges

public Collection<LineSeg3D> getEdges()
Get the edges of this triangle

Returns:
the edges

getVertices

public Collection<Coord3D> getVertices()
Get the vertices of the triangle

Returns:
the vertices as a Collection

getVerticesArray

public Coord3D[] getVerticesArray()
Get the vertices of the triangle as an array

Returns:
the vertices

hasEdge

public boolean hasEdge(LineSeg3D edge)
Parameters:
edge - a line segment
Returns:
true, if the segment makes up one of the edges of this triangle

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()