Package geometries

Class Triangle

java.lang.Object
All Implemented Interfaces:
Intersectible

public class Triangle
extends Polygon
This class represents a triangle in three dimensional space. It is a polygon with specifically three vertices.
  • Field Summary

    Fields inherited from class geometries.Geometry

    material
  • Constructor Summary

    Constructors
    Constructor Description
    Triangle​(Material material, Point p1, Point p2, Point p3)
    Constructs a triangle from three Points.
  • Method Summary

    Methods inherited from class geometries.Polygon

    boundary, intersect, normal

    Methods inherited from class geometries.Geometry

    intersection

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Triangle

      public Triangle​(Material material, Point p1, Point p2, Point p3)
      Constructs a triangle from three Points.
      Parameters:
      material - The Material the triangle is made from.
      p1 - A vertex of the triangle.
      p2 - A vertex of the triangle.
      p3 - A vertex of the triangle.
      Throws:
      java.lang.IllegalArgumentException - if the given Points are colinear.