es.ucm.look.ar.math.geom
Class Triangle

java.lang.Object
  extended by es.ucm.look.ar.math.geom.Triangle

public class Triangle
extends java.lang.Object

Represents a geometric triangle


Constructor Summary
Triangle(Point3 p1, Point3 p2, Point3 p3)
          Constructs a triangle from 3 points
 
Method Summary
 boolean contains(Point3 p)
          Returns if the given point is contained in this triangle.
 Plane getPlane()
          Returns the plain that contains this triangle
 Point3[] getPoints()
          Returns a 3 elements array with the points
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Triangle

public Triangle(Point3 p1,
                Point3 p2,
                Point3 p3)
Constructs a triangle from 3 points

Parameters:
p1 - Point 1
p2 - Point 2
p3 - Point 3
Method Detail

contains

public boolean contains(Point3 p)
Returns if the given point is contained in this triangle.

Parameters:
p - the point. It must be contained in the same plane as the triangle
Returns:
true if the point is contained by the triangle, false otherwise

getPlane

public Plane getPlane()
Returns the plain that contains this triangle

Returns:
the plain that contains this triangle

getPoints

public Point3[] getPoints()
Returns a 3 elements array with the points

Returns:
a 3 elements array with the points