Class Ellipsoid


  • public class Ellipsoid
    extends java.lang.Object
    Oblate ellipsoid with semi-major axis and inverse flattening.
    • Constructor Summary

      Constructors 
      Constructor Description
      Ellipsoid()
      Constructs an ellipsoid with semi-major axis and inverse flattening both 1.0.
      Ellipsoid​(double semiMajorAxis, double inverseFlattening)
      Constructs an ellipsoid with a specified semi-major axis and inverse flattening.
      Ellipsoid​(Ellipsoid ellipsoid)
      Constructs an ellipsoid with the semi-major axis and inverse flattening of a specified ellipsoid.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double eccentricitySquared()
      Computes this ellipsoid's eccentricity squared.
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      double inverseFlattening()
      Computes this ellipsoid's inverse flattening, a measure of an ellipsoid's compression.
      double semiMajorAxis()
      Computes this ellipsoid's semi-major axis length in meters.
      double semiMinorAxis()
      Computes this ellipsoid's semi-minor length axis in meters.
      Ellipsoid set​(double semiMajorAxis, double inverseFlattening)
      Sets this ellipsoid to a specified semi-major axis and inverse flattening.
      Ellipsoid set​(Ellipsoid ellipsoid)
      Sets this ellipsoid to the semi-major axis and inverse flattening of a specified ellipsoid.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Ellipsoid

        public Ellipsoid()
        Constructs an ellipsoid with semi-major axis and inverse flattening both 1.0.
      • Ellipsoid

        public Ellipsoid​(double semiMajorAxis,
                         double inverseFlattening)
        Constructs an ellipsoid with a specified semi-major axis and inverse flattening.
        Parameters:
        semiMajorAxis - one half of the ellipsoid's major axis length in meters, which runs through the center to opposite points on the equator
        inverseFlattening - measure of the ellipsoid's compression, indicating how much the semi-minor axis is compressed relative to the semi-major axis
      • Ellipsoid

        public Ellipsoid​(Ellipsoid ellipsoid)
        Constructs an ellipsoid with the semi-major axis and inverse flattening of a specified ellipsoid.
        Parameters:
        ellipsoid - the ellipsoid specifying the values
        Throws:
        java.lang.IllegalArgumentException - If the ellipsoid is null
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        @NonNull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • set

        public Ellipsoid set​(double semiMajorAxis,
                             double inverseFlattening)
        Sets this ellipsoid to a specified semi-major axis and inverse flattening.
        Parameters:
        semiMajorAxis - the new semi-major axis length in meters, one half of the ellipsoid's major axis, which runs through the center to opposite points on the equator
        inverseFlattening - the new inverse flattening, a measure of the ellipsoid's compression, indicating how much the semi-minor axis is compressed relative to the semi-major axis
        Returns:
        this ellipsoid with its semi-major axis and inverse flattening set to the specified values
      • set

        public Ellipsoid set​(Ellipsoid ellipsoid)
        Sets this ellipsoid to the semi-major axis and inverse flattening of a specified ellipsoid.
        Parameters:
        ellipsoid - the ellipsoid specifying the new values
        Returns:
        this ellipsoid with its semi-major axis and inverse flattening set to that of the specified ellipsoid
        Throws:
        java.lang.IllegalArgumentException - If the ellipsoid is null
      • semiMajorAxis

        public double semiMajorAxis()
        Computes this ellipsoid's semi-major axis length in meters. The semi-major axis is one half of the ellipsoid's major axis, which runs through the center to opposite points on the equator.
        Returns:
        this ellipsoid's semi-major axis length in meters
      • semiMinorAxis

        public double semiMinorAxis()
        Computes this ellipsoid's semi-minor length axis in meters. The semi-minor axis is one half of the ellipsoid's minor axis, which runs through the center to opposite points on the poles.
        Returns:
        this ellipsoid's semi-minor axis length in meters
      • inverseFlattening

        public double inverseFlattening()
        Computes this ellipsoid's inverse flattening, a measure of an ellipsoid's compression. The returned value is equivalent to a / (a - b), where a and b indicate this ellipsoid's semi-major axis and semi-minor axis, respectively.
        Returns:
        this ellipsoid's inverse flattening
      • eccentricitySquared

        public double eccentricitySquared()
        Computes this ellipsoid's eccentricity squared. The returned value is equivalent to 2*f - f*f, where f is this ellipsoid's flattening.
        Returns:
        this ellipsoid's eccentricity squared