Class NEDGravity

java.lang.Object
com.irurueta.navigation.inertial.NEDGravity
All Implemented Interfaces:
Serializable, Cloneable

public class NEDGravity extends Object implements Serializable, Cloneable
Contains acceleration due to gravity resolved about NED frame.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Number of components.
    private double
    Acceleration due to gravity through down-axis of NED frame and expressed in meters per squared second (m/s^2).
    private double
    Acceleration due to gravity through north-axis of NED frame and expressed in meters per squared second (m/s^2).
    static final double
    Acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
    private static final long
    Serialization version.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
    NEDGravity(double gn, double gd)
    Constructor.
    Constructor.
    NEDGravity(com.irurueta.units.Acceleration gn, com.irurueta.units.Acceleration gd)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Gets gravity coordinates as an array.
    void
    asArray(double[] result)
    Gets gravity coordinates as an array.
    com.irurueta.algebra.Matrix
    Gets gravity coordinates as a column matrix.
    void
    asMatrix(com.irurueta.algebra.Matrix result)
    Gets gravity coordinates as a column matrix.
    protected Object
    Makes a copy of this instance.
    void
    Copies data of provided instance into this instance.
    void
    Copies this instance data into provided instance.
    boolean
    Checks if provided instance has exactly the same contents as this instance.
    boolean
    equals(NEDGravity other, double threshold)
    Checks if provided instance has contents similar to this instance up to provided threshold value.
    boolean
    Check if provided object is a GravityNED instance having exactly the same contents as this instance.
    double
    Gets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
    com.irurueta.units.Acceleration
    Gets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
    void
    getGdAsAcceleration(com.irurueta.units.Acceleration result)
    Gets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
    double
    Gets acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
    com.irurueta.units.Acceleration
    Gets acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
    void
    getGeAsAcceleration(com.irurueta.units.Acceleration result)
    Gets acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
    double
    Gets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
    com.irurueta.units.Acceleration
    Gets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
    void
    getGnAsAcceleration(com.irurueta.units.Acceleration result)
    Gets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
    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 gn, double gd)
    Sets gravity coordinates resolved about NED frame and expressed in meters per squared second (m/s^2).
    void
    setCoordinates(com.irurueta.units.Acceleration gravityN, com.irurueta.units.Acceleration gravityD)
    Sets gravity coordinates.
    void
    setGd(double gd)
    Sets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
    void
    setGd(com.irurueta.units.Acceleration gravityD)
    Sets acceleration due to gravity through down-axis of NED frame.
    void
    setGn(double gn)
    Sets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
    void
    setGn(com.irurueta.units.Acceleration gravityN)
    Sets acceleration due to gravity through north-axis of NED frame.

    Methods inherited from class java.lang.Object

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

    • GRAVITY_EAST

      public static final double GRAVITY_EAST
      Acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
      See Also:
    • COMPONENTS

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

      private static final long serialVersionUID
      Serialization version. This is used to ensure compatibility of deserialization of permanently stored serialized instances.
      See Also:
    • gn

      private double gn
      Acceleration due to gravity through north-axis of NED frame and expressed in meters per squared second (m/s^2).
    • gd

      private double gd
      Acceleration due to gravity through down-axis of NED frame and expressed in meters per squared second (m/s^2).
  • Constructor Details

    • NEDGravity

      public NEDGravity()
      Constructor.
    • NEDGravity

      public NEDGravity(double gn, double gd)
      Constructor.
      Parameters:
      gn - acceleration due to gravity through north-axis of NED frame and expressed in meters per squared second (m/s^2).
      gd - acceleration due to gravity through down-axis of NED frame and expressed in meters per squared second (m/s^2).
    • NEDGravity

      public NEDGravity(com.irurueta.units.Acceleration gn, com.irurueta.units.Acceleration gd)
      Constructor.
      Parameters:
      gn - acceleration due to gravity through north-axis of NED frame.
      gd - acceleration due to gravity through down-axis of NED frame.
    • NEDGravity

      public NEDGravity(NEDGravity input)
      Constructor.
      Parameters:
      input - instance to copy data from.
  • Method Details

    • getGn

      public double getGn()
      Gets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
    • setGn

      public void setGn(double gn)
      Sets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
      Parameters:
      gn - acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
    • getGe

      public double getGe()
      Gets acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
    • getGd

      public double getGd()
      Gets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
    • setGd

      public void setGd(double gd)
      Sets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
      Parameters:
      gd - acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
    • setCoordinates

      public void setCoordinates(double gn, double gd)
      Sets gravity coordinates resolved about NED frame and expressed in meters per squared second (m/s^2).
      Parameters:
      gn - acceleration due to gravity through north-axis of NED frame.
      gd - acceleration due to gravity through down-axis of NED frame.
    • getGnAsAcceleration

      public void getGnAsAcceleration(com.irurueta.units.Acceleration result)
      Gets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
      Parameters:
      result - instance where acceleration due to gravity through NED north-axis will be stored.
    • getGnAsAcceleration

      public com.irurueta.units.Acceleration getGnAsAcceleration()
      Gets acceleration due to gravity through north-axis of NED frame expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through NED north-axis.
    • setGn

      public void setGn(com.irurueta.units.Acceleration gravityN)
      Sets acceleration due to gravity through north-axis of NED frame.
      Parameters:
      gravityN - acceleration due to gravity through NED north-axis.
    • getGeAsAcceleration

      public void getGeAsAcceleration(com.irurueta.units.Acceleration result)
      Gets acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
      Parameters:
      result - instance where acceleration due to gravity through NED east-axis will be stored.
    • getGeAsAcceleration

      public com.irurueta.units.Acceleration getGeAsAcceleration()
      Gets acceleration due to gravity through east-axis of NED frame expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through NED east-axis.
    • getGdAsAcceleration

      public void getGdAsAcceleration(com.irurueta.units.Acceleration result)
      Gets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
      Parameters:
      result - instance where acceleration due to gravity through NED down-axis will be stored.
    • getGdAsAcceleration

      public com.irurueta.units.Acceleration getGdAsAcceleration()
      Gets acceleration due to gravity through down-axis of NED frame expressed in meters per squared second (m/s^2).
      Returns:
      acceleration due to gravity through NED down-axis.
    • setGd

      public void setGd(com.irurueta.units.Acceleration gravityD)
      Sets acceleration due to gravity through down-axis of NED frame.
      Parameters:
      gravityD - acceleration due to gravity through NED down-axis.
    • setCoordinates

      public void setCoordinates(com.irurueta.units.Acceleration gravityN, com.irurueta.units.Acceleration gravityD)
      Sets gravity coordinates.
      Parameters:
      gravityN - acceleration due to gravity through north-axis of NED frame.
      gravityD - acceleration due to gravity through down-axis of NED frame.
    • 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(NEDGravity output)
      Copies this instance data into provided instance.
      Parameters:
      output - destination instance where data will be copied to.
    • copyFrom

      public void copyFrom(NEDGravity 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 as an array.
      Parameters:
      result - array instance where gravity coordinates will be stored in n,e,d order.
      Throws:
      IllegalArgumentException - if provided array does not have length 3.
    • asArray

      public double[] asArray()
      Gets gravity coordinates as an array.
      Returns:
      array containing gravity coordinates in n,e,d order.
    • asMatrix

      public void asMatrix(com.irurueta.algebra.Matrix result)
      Gets gravity coordinates 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 n,e,d order.
    • asMatrix

      public com.irurueta.algebra.Matrix asMatrix()
      Gets gravity coordinates as a column matrix.
      Returns:
      a matrix containing gravity coordinates stored in n,e,d 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 boolean equals(Object obj)
      Check if provided object is a GravityNED 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(NEDGravity 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(NEDGravity 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.
    • clone

      protected Object clone() throws CloneNotSupportedException
      Makes a copy of this instance.
      Overrides:
      clone in class Object
      Returns:
      a copy of this instance.
      Throws:
      CloneNotSupportedException - if clone fails for some reason.