backend.spheremodel
Class SphereModel

java.lang.Object
  extended by java.util.Observable
      extended by backend.spheremodel.SphereModel

public class SphereModel
extends java.util.Observable

SphereModel is a model of our sphere


Constructor Summary
SphereModel(javax.vecmath.Point3f center, float radius)
          SphereModel default constructor
 
Method Summary
 float getArea()
          getArea will return the surface area of the sphere
 javax.vecmath.Point3f getCenter()
          getCenter returns a copy of the center point of the sphere
 float getCircumference()
          getCircumferenece will return the circumference of the sphere
 float getRadius()
          getRadius returns the current radius of the sphere
 float getRadiusSquared()
          getRadiusSquared returns the radius of the sphere squared.
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SphereModel

public SphereModel(javax.vecmath.Point3f center,
                   float radius)
SphereModel default constructor

Parameters:
center - the center point of the sphere
radius - the radius of the sphere
Method Detail

getRadius

public float getRadius()
getRadius returns the current radius of the sphere

Returns:
the radius of the sphere model

getRadiusSquared

public float getRadiusSquared()
getRadiusSquared returns the radius of the sphere squared. It is stored to improve efficency.

Returns:
The radius of the sphere squared

getCenter

public javax.vecmath.Point3f getCenter()
getCenter returns a copy of the center point of the sphere

Returns:
the center of the sphere

getCircumference

public float getCircumference()
getCircumferenece will return the circumference of the sphere

Returns:
the Sphere's circumference.

getArea

public float getArea()
getArea will return the surface area of the sphere

Returns:
surface area of the sphere