ProGAL.geom3d.volumes
Class Lens

java.lang.Object
  extended by ProGAL.geom3d.volumes.Lens
All Implemented Interfaces:
Shape, Volume

public class Lens
extends java.lang.Object
implements Volume

A lens is the intersection between two spheres.

Author:
R.Fonseca

Constructor Summary
Lens(Sphere s0, Sphere s1)
          Construct a lens from the two spheres.
 
Method Summary
 Lens clone()
          Make a deep clone this volume.
 double distance(Lens l)
           
 double distance(Point p)
           
 Point getCenter()
          Get the geometric center of the shape.
 double getFocalDistance(int i)
          The distance from a focal point to the equator of the lens
 double getRadius()
          Radius of the equator of the lens
 Point getSphereCenter(int i)
           
 double getSphereRadius(int i)
           
 double getVolume()
          The volume of the lens
static void main(java.lang.String[] args)
           
 boolean overlaps(Volume vol)
          Determine if this volume overlaps vol.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lens

public Lens(Sphere s0,
            Sphere s1)
Construct a lens from the two spheres. A IllegalArgumentException is thrown if the spheres have empty or single point intersection. Note that the two spheres given as arguments are not stored, and subsequent changes to the lens should be performed through appropriate setters.

Method Detail

getRadius

public double getRadius()
Radius of the equator of the lens


getFocalDistance

public double getFocalDistance(int i)
The distance from a focal point to the equator of the lens


getSphereRadius

public double getSphereRadius(int i)

getSphereCenter

public Point getSphereCenter(int i)

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

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()
The volume of the lens

Specified by:
getVolume in interface Volume

clone

public Lens 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

distance

public double distance(Point p)

distance

public double distance(Lens l)

main

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