Class GravityOrGravitation<T extends GravityOrGravitation<?>>

java.lang.Object
com.irurueta.navigation.inertial.GravityOrGravitation<T>
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ECEFGravity, ECIGravitation

public abstract class GravityOrGravitation<T extends GravityOrGravitation<?>> extends Object implements Serializable, Cloneable
Contains acceleration due to gravity resolved about ECEF or ECI frame, depending on the implementation.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Number of components.
    (package private) double
    Acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
    (package private) double
    Acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
    (package private) double
    Acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    GravityOrGravitation(double gx, double gy, double gz)
    Constructor.
    protected
    GravityOrGravitation(com.irurueta.units.Acceleration gx, com.irurueta.units.Acceleration gy, com.irurueta.units.Acceleration gz)
    Constructor.
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Gets gravity coordinates expressed in meters per squared second (m/s^2) as an array.
    void
    asArray(double[] result)
    Gets gravity coordinates expressed in meters per squared second (m/s^2) as an array.
    com.irurueta.algebra.Matrix
    Gets gravity coordinates as a column matrix.
    void
    asMatrix(com.irurueta.algebra.Matrix result)
    Gets gravity coordinates expressed in meters per squared second (m/s^2) as a column matrix.
    void
    copyFrom(T input)
    Copies data of provided instance into this instance.
    void
    copyTo(T output)
    Copies this instance data into provided instance.
    abstract boolean
    Check if provided object is a T instance having exactly the same contents as this instance.
    boolean
    equals(T other)
    Checks if provided instance has exactly the same contents as this instance.
    boolean
    equals(T other, double threshold)
    Checks if provided instance has contents similar to this instance up to provided threshold value.
    double
    Gets acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
    com.irurueta.units.Acceleration
    Gets acceleration due to gravity through ECI or ECEF x-axis.
    void
    getGxAsAcceleration(com.irurueta.units.Acceleration result)
    Gets acceleration due to gravity through ECI or ECEF x-axis.
    double
    Gets acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
    com.irurueta.units.Acceleration
    Gets acceleration due to gravity through ECI or ECEF y-axis.
    void
    getGyAsAcceleration(com.irurueta.units.Acceleration result)
    Gets acceleration due to gravity through ECI or ECEF y-axis.
    double
    Gets acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
    com.irurueta.units.Acceleration
    Gets acceleration due to gravity through ECI or ECEF z-axis.
    void
    getGzAsAcceleration(com.irurueta.units.Acceleration result)
    Gets acceleration due to gravity through ECI or ECEF z-axis.
    double
    Gets gravity norm.
    com.irurueta.units.Acceleration
    Gets gravity norm as an acceleration.
    void
    getNormAsAcceleration(com.irurueta.units.Acceleration result)
    Gets gravity norm as an acceleration.
    int
    Computes and returns hash code for this instance.
    void
    setCoordinates(double gx, double gy, double gz)
    Sets gravity coordinates resolved about ECI or ECEF frame and expressed in meters per squared second (m/s^2).
    void
    setCoordinates(com.irurueta.units.Acceleration gravityX, com.irurueta.units.Acceleration gravityY, com.irurueta.units.Acceleration gravityZ)
    Sets gravity coordinates.
    void
    setGx(double gx)
    Sets acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
    void
    setGx(com.irurueta.units.Acceleration gravityX)
    Sets acceleration due to gravity through ECI or ECEF x-axis.
    void
    setGy(double gy)
    Sets acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
    void
    setGy(com.irurueta.units.Acceleration gravityY)
    Sets acceleration due to gravity through ECI or ECEF y-axis.
    void
    setGz(double gz)
    Sets acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
    void
    setGz(com.irurueta.units.Acceleration gravityZ)
    Sets acceleration due to gravity through ECI or ECEF z-axis.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • COMPONENTS

      public static final int COMPONENTS
      Number of components.
      See Also:
    • gx

      double gx
      Acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
    • gy

      double gy
      Acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
    • gz

      double gz
      Acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
  • Constructor Details

    • GravityOrGravitation

      protected GravityOrGravitation()
      Constructor.
    • GravityOrGravitation

      protected GravityOrGravitation(double gx, double gy, double gz)
      Constructor.
      Parameters:
      gx - acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
      gy - acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
      gz - acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
    • GravityOrGravitation

      protected GravityOrGravitation(com.irurueta.units.Acceleration gx, com.irurueta.units.Acceleration gy, com.irurueta.units.Acceleration gz)
      Constructor.
      Parameters:
      gx - acceleration due to gravity through ECI or ECEF x-axis to be set.
      gy - acceleration due to gravity through ECI or ECEF y-axis to be set.
      gz - acceleration due to gravity through ECI or ECEF z-axis to be set.
    • GravityOrGravitation

      protected GravityOrGravitation(T input)
      Constructor.
      Parameters:
      input - instance to copy data from.
  • Method Details

    • getGx

      public double getGx()
      Gets acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through ECI or ECEF x-axis.
    • setGx

      public void setGx(double gx)
      Sets acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
      Parameters:
      gx - acceleration due to gravity through ECI or ECEF x-axis.
    • getGy

      public double getGy()
      Gets acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through ECI or ECEF y-axis.
    • setGy

      public void setGy(double gy)
      Sets acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
      Parameters:
      gy - acceleration due to gravity through ECI or ECEF y-axis.
    • getGz

      public double getGz()
      Gets acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through ECI or ECEF z-axis.
    • setGz

      public void setGz(double gz)
      Sets acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
      Parameters:
      gz - acceleration due to gravity through ECI or ECEF z-axis.
    • setCoordinates

      public void setCoordinates(double gx, double gy, double gz)
      Sets gravity coordinates resolved about ECI or ECEF frame and expressed in meters per squared second (m/s^2).
      Parameters:
      gx - acceleration due to gravity through ECI or ECEF x-axis expressed in meters per squared second (m/s^2).
      gy - acceleration due to gravity through ECI or ECEF y-axis expressed in meters per squared second (m/s^2).
      gz - acceleration due to gravity through ECI or ECEF z-axis expressed in meters per squared second (m/s^2).
    • getGxAsAcceleration

      public void getGxAsAcceleration(com.irurueta.units.Acceleration result)
      Gets acceleration due to gravity through ECI or ECEF x-axis.
      Parameters:
      result - instance where acceleration due to gravity through ECI or ECEF x-axis will be stored.
    • getGxAsAcceleration

      public com.irurueta.units.Acceleration getGxAsAcceleration()
      Gets acceleration due to gravity through ECI or ECEF x-axis.
      Returns:
      acceleration due to gravity through ECI or ECEF x-axis.
    • setGx

      public void setGx(com.irurueta.units.Acceleration gravityX)
      Sets acceleration due to gravity through ECI or ECEF x-axis.
      Parameters:
      gravityX - acceleration due to gravity through ECI or ECEF x-axis to be set.
    • getGyAsAcceleration

      public void getGyAsAcceleration(com.irurueta.units.Acceleration result)
      Gets acceleration due to gravity through ECI or ECEF y-axis.
      Parameters:
      result - instance where acceleration due to gravity through ECI or ECEF y-axis will be stored.
    • getGyAsAcceleration

      public com.irurueta.units.Acceleration getGyAsAcceleration()
      Gets acceleration due to gravity through ECI or ECEF y-axis.
      Returns:
      acceleration due to gravity through ECI or ECEF y-axis.
    • setGy

      public void setGy(com.irurueta.units.Acceleration gravityY)
      Sets acceleration due to gravity through ECI or ECEF y-axis.
      Parameters:
      gravityY - acceleration due to gravity through ECI or ECEF y-axis to be set.
    • getGzAsAcceleration

      public void getGzAsAcceleration(com.irurueta.units.Acceleration result)
      Gets acceleration due to gravity through ECI or ECEF z-axis.
      Parameters:
      result - instance where acceleration due to gravity through ECI or ECEF z-axis will be stored.
    • getGzAsAcceleration

      public com.irurueta.units.Acceleration getGzAsAcceleration()
      Gets acceleration due to gravity through ECI or ECEF z-axis.
      Returns:
      acceleration due to gravity through ECI or ECEF z-axis.
    • setGz

      public void setGz(com.irurueta.units.Acceleration gravityZ)
      Sets acceleration due to gravity through ECI or ECEF z-axis.
      Parameters:
      gravityZ - acceleration due to gravity through ECI or ECEF z-axis to be set.
    • setCoordinates

      public void setCoordinates(com.irurueta.units.Acceleration gravityX, com.irurueta.units.Acceleration gravityY, com.irurueta.units.Acceleration gravityZ)
      Sets gravity coordinates.
      Parameters:
      gravityX - acceleration due to gravity through ECI or ECEF x-axis to be set.
      gravityY - acceleration due to gravity through ECI or ECEF y-axis to be set.
      gravityZ - acceleration due to gravity through ECI or ECEF z-axis to be set.
    • getNorm

      public double getNorm()
      Gets gravity norm.
      Returns:
      gravity norm.
    • getNormAsAcceleration

      public void getNormAsAcceleration(com.irurueta.units.Acceleration result)
      Gets gravity norm as an acceleration.
      Parameters:
      result - instance where result will be stored.
    • getNormAsAcceleration

      public com.irurueta.units.Acceleration getNormAsAcceleration()
      Gets gravity norm as an acceleration.
      Returns:
      an acceleration containing gravity norm.
    • copyTo

      public void copyTo(T output)
      Copies this instance data into provided instance.
      Parameters:
      output - destination instance where data will be copied to.
    • copyFrom

      public void copyFrom(T input)
      Copies data of provided instance into this instance.
      Parameters:
      input - instance to copy data from.
    • asArray

      public void asArray(double[] result)
      Gets gravity coordinates expressed in meters per squared second (m/s^2) as an array.
      Parameters:
      result - array instance where gravity coordinates will be stored in x,y,z order.
      Throws:
      IllegalArgumentException - if provided array does not have length 3.
    • asArray

      public double[] asArray()
      Gets gravity coordinates expressed in meters per squared second (m/s^2) as an array.
      Returns:
      array containing gravity coordinates in x,y,z order.
    • asMatrix

      public void asMatrix(com.irurueta.algebra.Matrix result)
      Gets gravity coordinates expressed in meters per squared second (m/s^2) as a column matrix. If provided matrix does not have size 3x1, it will be resized.
      Parameters:
      result - matrix instance where gravity coordinates will be stored in x,y,z order.
    • asMatrix

      public com.irurueta.algebra.Matrix asMatrix()
      Gets gravity coordinates as a column matrix.
      Returns:
      a matrix containing gravity coordinates stored in x,y,z order.
    • hashCode

      public int hashCode()
      Computes and returns hash code for this instance. Hash codes are almost unique values that are useful for fast classification and storage of objects in collections.
      Overrides:
      hashCode in class Object
      Returns:
      Hash code.
    • equals

      public abstract boolean equals(Object obj)
      Check if provided object is a T instance having exactly the same contents as this instance.
      Overrides:
      equals in class Object
      Parameters:
      obj - object to be compared.
      Returns:
      true if both objects are considered to be equal, false otherwise.
    • equals

      public boolean equals(T other)
      Checks if provided instance has exactly the same contents as this instance.
      Parameters:
      other - instance to be compared.
      Returns:
      true if both instances are considered to be equal, false otherwise.
    • equals

      public boolean equals(T other, double threshold)
      Checks if provided instance has contents similar to this instance up to provided threshold value.
      Parameters:
      other - instance to be compared.
      threshold - maximum allowed difference between gravity coordinates.
      Returns:
      true if both instances are considered to be equal (up to provided threshold), false otherwise.