Class SphereRegion

java.lang.Object
net.apartium.cocoabeans.space.SphereRegion
All Implemented Interfaces:
Region

@AvailableSince("0.0.22") public class SphereRegion extends Object implements Region
Represents a sphere region.
  • Constructor Details

    • SphereRegion

      public SphereRegion(Position center, double radius)
  • Method Details

    • contains

      public boolean contains(Position position)
      Description copied from interface: Region
      Check if the position is in the region
      Specified by:
      contains in interface Region
      Parameters:
      position - position to check
      Returns:
      true if the position is in the region or false otherwise
    • distance

      public double distance(Position position)
      Description copied from interface: Region
      Return the distance between region and position If position is inside the region, return 0 (Note that this is not the same as the distance between the region and the center of the region) (Note this method is more expensive than Region.contains(Position) method when you just want to check if the position is inside the region)
      Specified by:
      distance in interface Region
      Parameters:
      position - position
      Returns:
      distance between region and position (or 0 if position is inside the region)
    • getCenter

      public Position getCenter()
    • getRadius

      public double getRadius()
    • setCenter

      public void setCenter(Position center)
    • setRadius

      public void setRadius(double radius)