Class Sphere

java.lang.Object
inra.ijpb.geometry.Sphere

public class Sphere
extends java.lang.Object
Contains data for representing sphere in the 3D space. Used for the computation of largest inscribed ball.
Author:
dlegland
See Also:
LargestInscribedBall
  • Constructor Summary

    Constructors
    Constructor Description
    Sphere​(Point3D center, double radius)
    Creates a new sphere from a center and a radius.
  • Method Summary

    Modifier and Type Method Description
    Point3D center()  
    double radius()  
    double surfaceArea()  
    double volume()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Sphere

      public Sphere​(Point3D center, double radius)
      Creates a new sphere from a center and a radius.
      Parameters:
      center - the center of the sphere
      radius - the radius of the sphere
  • Method Details

    • volume

      public double volume()
      Returns:
      the volume of the domain enclosed by the sphere (equal to (4*pi/3) * r^3 )
    • surfaceArea

      public double surfaceArea()
      Returns:
      the surface area of the sphere (equal to 4*pi*r)
    • center

      public Point3D center()
      Returns:
      the center of the sphere
    • radius

      public double radius()
      Returns:
      the radius of the sphere