/** Sphere.java provides sphere-related methods.
 * @author Joel Adams, for Alice+Java
 *
 */

public class Sphere {
	
	private double myRadius;
	
	/** constructor
	 * @param radius, a double
	 * Precondition: radius > 0.
	 * Postcondition: myRadius == radius.
	 */
	public Sphere(double radius) {
		myRadius = radius;
	}
	
	/** volume of a Sphere (instance method)
	 * @return my volume.
	 */
	public double volume() { return volume(myRadius); }
	
	public double getRadius() {	return myRadius; }
	
	/** volume of a sphere
	 * @param radius, the (double) radius of the sphere
	 * @return the volume of a sphere with that radius
	 */
	public static double volume(double radius) {
		return 4.0 / 3.0 * Math.PI * Math.pow(radius, 3.0);
	}
}
