Record Class CircleArea

java.lang.Object
java.lang.Record
gaiasky.util.gaia.utils.CircleArea
All Implemented Interfaces:
Area

public record CircleArea(Place centre, double radius) extends Record implements Area
  • Constructor Summary

    Constructors
    Constructor
    Description
    CircleArea(Place centre, double radius)
    Creates an instance of a CircleArea about a given centre and radius.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Determine the minimum angle between a great circle and the Area boundary
    Returns the value of the centre record component.
    boolean
    Determine whether a given Place is within the Area
    final boolean
    Indicates whether some other object is "equal to" this one.
    Determine the weighted mid-point of the Area
    double
     
    double
    Determine the weight of the Area
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the radius record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CircleArea

      public CircleArea(Place centre, double radius)
      Creates an instance of a CircleArea about a given centre and radius.
      Parameters:
      centre - the centre
      radius - the radius [rad]
  • Method Details

    • altitude

      public double altitude(Place pole)
      Description copied from interface: Area
      Determine the minimum angle between a great circle and the Area boundary
      Specified by:
      altitude in interface Area
      Parameters:
      pole - great circle pole given as a Place
      Returns:
      minimum angle [rad]
    • contains

      public boolean contains(Place p)
      Description copied from interface: Area
      Determine whether a given Place is within the Area
      Specified by:
      contains in interface Area
      Parameters:
      p - the Place
      Returns:
      true if p is within the Area
    • getMidPoint

      public Place getMidPoint()
      Description copied from interface: Area
      Determine the weighted mid-point of the Area
      Specified by:
      getMidPoint in interface Area
      Returns:
      the centre
    • getWeight

      public double getWeight()
      Description copied from interface: Area
      Determine the weight of the Area
      Specified by:
      getWeight in interface Area
      Returns:
      the weight
    • centre

      public Place centre()
      Returns the value of the centre record component.
      Returns:
      the value of the centre record component
    • radius

      public double radius()
      Returns the value of the radius record component.
      Returns:
      the value of the radius record component
    • getSquareDegrees

      public double getSquareDegrees()
      Returns:
      the solid angle [deg^2]
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.