net.algart.drawing3d
Class Sphere3D

java.lang.Object
  extended by net.algart.drawing3d.Sphere3D
All Implemented Interfaces:
Shape3D

public class Sphere3D
extends java.lang.Object
implements Shape3D

3D sphere.

This class is immutable and thread-safe: there are no ways to modify settings of the created instance.

AlgART Laboratory 2010

Since:
JDK 1.5
Version:
1.0
Author:
Daniel Alievsky

Constructor Summary
Constructor and Description
Sphere3D(double centerX, double centerY, double centerZ, double radius)
          Creates new sphere with the given coordinates of the center and the radius.
 
Method Summary
Modifier and Type Method and Description
 double getCenterX()
          Returns x-coordinate of the center of the sphere.
 double getCenterY()
          Returns y-coordinate of the center of the sphere.
 double getCenterZ()
          Returns z-coordinate of the center of the sphere.
 double getRadius()
          Returns the radius of the sphere.
 java.lang.String toString()
          Returns a brief string description of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sphere3D

public Sphere3D(double centerX,
                double centerY,
                double centerZ,
                double radius)
Creates new sphere with the given coordinates of the center and the radius.

Parameters:
centerX - x-coordinate of the center.
centerY - y-coordinate of the center.
centerZ - z-coordinate of the center.
radius - the radius of the sphere.
Throws:
java.lang.IllegalArgumentException - if the passed radius is negative (< 0).
Method Detail

getCenterX

public double getCenterX()
Returns x-coordinate of the center of the sphere.

Returns:
x-coordinate of the center of the sphere.

getCenterY

public double getCenterY()
Returns y-coordinate of the center of the sphere.

Returns:
y-coordinate of the center of the sphere.

getCenterZ

public double getCenterZ()
Returns z-coordinate of the center of the sphere.

Returns:
z-coordinate of the center of the sphere.

getRadius

public double getRadius()
Returns the radius of the sphere.

Returns:
the radius of the sphere.

toString

public java.lang.String toString()
Returns a brief string description of this object.

The result of this method may depend on implementation.

Overrides:
toString in class java.lang.Object
Returns:
a brief string description of this object.


Hot at AlgART: HTML для чайников | Trinity for non-Christians | Диалог с Богом | Religion and Geometry