ProGAL.geom3d.volumes
Class Tetrahedron

java.lang.Object
  extended by ProGAL.geom3d.volumes.Tetrahedron
All Implemented Interfaces:
Shape, Simplex, Volume
Direct Known Subclasses:
CTetrahedron, Tetr

public class Tetrahedron
extends java.lang.Object
implements Simplex, Volume

A tetrahedron is a polyhedron with four triangular faces. It is defined using four corner-points.

Author:
R.Fonseca

Constructor Summary
Tetrahedron(Point[] corners)
           
Tetrahedron(Point p1, Point p2, Point p3, Point p4)
           
 
Method Summary
 void blowUp(double t)
           
 Point circumCenter()
          Find the center of the circumscribing sphere.
 double circumRadius()
          Calculate the radius of the circumsphere.
 Sphere circumSphere()
          Find the circumscribing sphere
 Volume clone()
          Make a deep clone this volume.
 Point getCenter()
          Get the geometric center of the shape.
 Triangle getCommonTriangle(Tetrahedron t)
          Return common triangle of 2 tetrahedra
 Point getCorner(int c)
          Return the specified corner.
 Point[] getCorners()
          Return all four corners
 int getDimension()
          Return the 'dimension' of this object.
 double getInradius()
          Calculate the radius of the insphere.
 Point getPoint(int c)
          Return the specified corner-point.
 double getVolume()
          Get the volume of the tetrahedron.
 Point incenter()
          Find the center of the inscribed sphere.
 boolean isAcute()
           
 boolean isInside(Point p)
          Returns true if the point p is inside this tetrahedron.
static void main(java.lang.String[] args)
           
 boolean overlaps(Volume vol)
          Determine if this volume overlaps vol.
static Tetrahedron regularTetrahedron()
           
 void setPoint(int c, Point point)
          TODO: Comment
 void toConsole()
          Writes this tetrahedron to System.out.
 void toConsole(int dec)
          Writes this tetrahedron to System.out with dec decimals precision.
 void toScene(J3DScene scene)
           
 java.lang.String toString()
          Return a string representation of this tetrahedron.
 java.lang.String toString(int dec)
          Return a string representation of this tetrahedron with dec decimals precision
 void translate(double x, double y, double z)
           
 void translate(Point q)
           
 void translate(Vector v)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tetrahedron

public Tetrahedron(Point p1,
                   Point p2,
                   Point p3,
                   Point p4)

Tetrahedron

public Tetrahedron(Point[] corners)
Method Detail

regularTetrahedron

public static Tetrahedron regularTetrahedron()

getCorner

public Point getCorner(int c)
Return the specified corner. Throws an error if c<0 || c>3.


getCorners

public Point[] getCorners()
Return all four corners


translate

public void translate(Vector v)

translate

public void translate(Point q)

translate

public void translate(double x,
                      double y,
                      double z)

blowUp

public void blowUp(double t)

getPoint

public Point getPoint(int c)
Return the specified corner-point. Throws an error if c<0 || c>3.

Specified by:
getPoint in interface Simplex

getDimension

public int getDimension()
Return the 'dimension' of this object. Required by the interface Simplex.

Specified by:
getDimension in interface Simplex

setPoint

public void setPoint(int c,
                     Point point)
TODO: Comment


overlaps

public boolean overlaps(Volume vol)
Description copied from interface: Volume
Determine if this volume overlaps vol. Two volumes overlap if their surfaces touch or if the union of interiors is non-empty.

Specified by:
overlaps in interface Volume

getVolume

public double getVolume()
Get the volume of the tetrahedron.

Specified by:
getVolume in interface Volume

getCommonTriangle

public Triangle getCommonTriangle(Tetrahedron t)
Return common triangle of 2 tetrahedra


getInradius

public double getInradius()
Calculate the radius of the insphere.


circumRadius

public double circumRadius()
Calculate the radius of the circumsphere.


circumCenter

public Point circumCenter()
Find the center of the circumscribing sphere.


circumSphere

public Sphere circumSphere()
Find the circumscribing sphere


incenter

public Point incenter()
Find the center of the inscribed sphere.


getCenter

public Point getCenter()
Description copied from interface: Shape
Get the geometric center of the shape. The center of a shape can be interpreted in many ways (center of mass, circumcenter, inscribed center etc.). No strict requirement is given here, but typically the circumcenter should be supplied. This method is most prominently used to find the average center-position of a collection of shapes such that scene-viewers can be centered on the scene.

Specified by:
getCenter in interface Shape

isInside

public boolean isInside(Point p)
Returns true if the point p is inside this tetrahedron.


isAcute

public boolean isAcute()

clone

public Volume clone()
Description copied from interface: Volume
Make a deep clone this volume.

Specified by:
clone in interface Volume
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Return a string representation of this tetrahedron.

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(int dec)
Return a string representation of this tetrahedron with dec decimals precision


toConsole

public void toConsole()
Writes this tetrahedron to System.out.


toConsole

public void toConsole(int dec)
Writes this tetrahedron to System.out with dec decimals precision.


toScene

public void toScene(J3DScene scene)

main

public static void main(java.lang.String[] args)