Class ECEFPosition

java.lang.Object
com.irurueta.navigation.frames.ECEFPosition
All Implemented Interfaces:
Serializable, Cloneable

public class ECEFPosition extends Object implements Serializable, Cloneable
Contains body cartesian position with respect Earth, resolved about ECEF frame and expressed in meters (m).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Number of components.
    private double
    Cartesian x coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    private double
    Cartesian y coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    private double
    Cartesian z coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
    ECEFPosition(double x, double y, double z)
    Constructor.
    Constructor.
    ECEFPosition(com.irurueta.units.Distance x, com.irurueta.units.Distance y, com.irurueta.units.Distance z)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Gets position coordinates expressed in meters (m) as an array.
    void
    asArray(double[] result)
    Gets position coordinates expressed in meters (m) as an array.
    com.irurueta.algebra.Matrix
    Gets position coordinates expressed in meters (m) as a column matrix.
    void
    asMatrix(com.irurueta.algebra.Matrix result)
    Gets position coordinates expressed in meters (m) as a column matrix.
    protected Object
    Makes a copy of this instance.
    private double
    convertDistance(com.irurueta.units.Distance distance)
    Converts distance instance into meters value.
    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(ECEFPosition other, double threshold)
    Checks if provided instance has contents similar to this instance up to provided threshold value.
    boolean
    Checks if provided object is an ECEFPosition having exactly the same contents as this instance.
    com.irurueta.units.Distance
    Gets cartesian x coordinate of body position resolved along ECEF-frame axes.
    void
    getDistanceX(com.irurueta.units.Distance result)
    Gets cartesian x coordinate of body position resolved along ECEF-frame axes.
    com.irurueta.units.Distance
    Gets cartesian y coordinate of body position resolved along ECEF-frame axes.
    void
    getDistanceY(com.irurueta.units.Distance result)
    Gets cartesian y coordinate of body position resolved along ECEF-frame axes.
    com.irurueta.units.Distance
    Gets cartesian z coordinate of body position resolved along ECEF-frame axes.
    void
    getDistanceZ(com.irurueta.units.Distance result)
    Gets cartesian z coordinate of body position resolved along ECEF-frame axes.
    double
    Gets norm of position expressed in meters (m), which represents the distance to Earth's center of mass.
    com.irurueta.units.Distance
    Gets norm of position, which represents the distance to Earth's center of mass.
    void
    getNormAsDistance(com.irurueta.units.Distance result)
    Gets norm of position, which represents the distance to Earth's center of mass.
    com.irurueta.geometry.Point3D
    Gets body position expressed in meters (m) and resolved along ECEF-frame axes.
    void
    getPosition(com.irurueta.geometry.Point3D result)
    Gets body position expressed in meters (m) and resolved along ECEF-frame axes.
    double
    Gets cartesian x coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    double
    Gets cartesian y coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    double
    Gets cartesian z coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    int
    Computes and returns hash code for this instance.
    void
    setCoordinates(double x, double y, double z)
    Sets cartesian coordinates of body position expressed in meters (m) and resolved along ECEF-frame axes.
    void
    setCoordinates(com.irurueta.units.Distance x, com.irurueta.units.Distance y, com.irurueta.units.Distance z)
    Sets cartesian coordinates of body position and resolved along ECEF-frame axes.
    void
    setPosition(com.irurueta.geometry.Point3D point)
    Sets body position expressed in meters (m) and resolved along ECEF-frame axes.
    void
    setX(double x)
    Sets cartesian x coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    void
    setX(com.irurueta.units.Distance x)
    Sets cartesian x coordinate of body position resolved along ECEF-frame axes.
    void
    setY(double y)
    Sets cartesian y coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    void
    setY(com.irurueta.units.Distance y)
    Sets cartesian y coordinate of body position resolved along ECEF-frame axes.
    void
    setZ(double z)
    Sets cartesian z coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    void
    setZ(com.irurueta.units.Distance z)
    Sets cartesian z coordinate of body position resolved along ECEF-frame axes.

    Methods inherited from class java.lang.Object

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

    • COMPONENTS

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

      private double x
      Cartesian x coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    • y

      private double y
      Cartesian y coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
    • z

      private double z
      Cartesian z coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
  • Constructor Details

    • ECEFPosition

      public ECEFPosition()
      Constructor.
    • ECEFPosition

      public ECEFPosition(double x, double y, double z)
      Constructor.
      Parameters:
      x - cartesian x coordinate of body position expressed in meters (m) and resolved along ECEF-frame axes.
      y - cartesian y coordinate of body position expressed in meters (m) and resolved along ECEF-frame axes.
      z - cartesian z coordinate of body position expressed in meters (m) and resolved along ECEF-frame axes.
    • ECEFPosition

      public ECEFPosition(com.irurueta.units.Distance x, com.irurueta.units.Distance y, com.irurueta.units.Distance z)
      Constructor.
      Parameters:
      x - cartesian x coordinate of body position resolved along ECEF-frame axes.
      y - cartesian y coordinate of body position resolved along ECEF-frame axes.
      z - cartesian z coordinate of body position resolved along ECEF-frame axes.
    • ECEFPosition

      public ECEFPosition(ECEFPosition input)
      Constructor.
      Parameters:
      input - ECEF body position to copy data from.
  • Method Details

    • getX

      public double getX()
      Gets cartesian x coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
      Returns:
      cartesian x coordinate of body position.
    • setX

      public void setX(double x)
      Sets cartesian x coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
      Parameters:
      x - cartesian x coordinate of body position.
    • getY

      public double getY()
      Gets cartesian y coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
      Returns:
      cartesian y coordinate of body position.
    • setY

      public void setY(double y)
      Sets cartesian y coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
      Parameters:
      y - cartesian y coordinate of body position.
    • getZ

      public double getZ()
      Gets cartesian z coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
      Returns:
      z coordinate of body position.
    • setZ

      public void setZ(double z)
      Sets cartesian z coordinate of body position expressed in meters (m) with respect ECEF frame, resolved along ECEF axes.
      Parameters:
      z - cartesian z coordinate of body position.
    • setCoordinates

      public void setCoordinates(double x, double y, double z)
      Sets cartesian coordinates of body position expressed in meters (m) and resolved along ECEF-frame axes.
      Parameters:
      x - cartesian x coordinate of body position.
      y - cartesian y coordinate of body position.
      z - cartesian z coordinate of body position.
    • getPosition

      public com.irurueta.geometry.Point3D getPosition()
      Gets body position expressed in meters (m) and resolved along ECEF-frame axes.
      Returns:
      body position.
    • getPosition

      public void getPosition(com.irurueta.geometry.Point3D result)
      Gets body position expressed in meters (m) and resolved along ECEF-frame axes.
      Parameters:
      result - instance where position data is copied to.
    • setPosition

      public void setPosition(com.irurueta.geometry.Point3D point)
      Sets body position expressed in meters (m) and resolved along ECEF-frame axes.
      Parameters:
      point - body position to be set.
    • getDistanceX

      public void getDistanceX(com.irurueta.units.Distance result)
      Gets cartesian x coordinate of body position resolved along ECEF-frame axes.
      Parameters:
      result - instance where cartesian x coordinate of body position will be stored.
    • getDistanceX

      public com.irurueta.units.Distance getDistanceX()
      Gets cartesian x coordinate of body position resolved along ECEF-frame axes.
      Returns:
      x coordinate of body position resolved along ECEF-frame axes.
    • setX

      public void setX(com.irurueta.units.Distance x)
      Sets cartesian x coordinate of body position resolved along ECEF-frame axes.
      Parameters:
      x - cartesian x coordinate of body position to be set.
    • getDistanceY

      public void getDistanceY(com.irurueta.units.Distance result)
      Gets cartesian y coordinate of body position resolved along ECEF-frame axes.
      Parameters:
      result - instance where cartesian y coordinate of body position will be stored.
    • getDistanceY

      public com.irurueta.units.Distance getDistanceY()
      Gets cartesian y coordinate of body position resolved along ECEF-frame axes.
      Returns:
      y coordinate of body position resolved along ECEF-frame axes.
    • setY

      public void setY(com.irurueta.units.Distance y)
      Sets cartesian y coordinate of body position resolved along ECEF-frame axes.
      Parameters:
      y - cartesian y coordinate of body position to be set.
    • getDistanceZ

      public void getDistanceZ(com.irurueta.units.Distance result)
      Gets cartesian z coordinate of body position resolved along ECEF-frame axes.
      Parameters:
      result - instance where cartesian z coordinate of body position will be stored.
    • getDistanceZ

      public com.irurueta.units.Distance getDistanceZ()
      Gets cartesian z coordinate of body position resolved along ECEF-frame axes.
      Returns:
      z coordinate of body position resolved along ECEF-frame axes.
    • setZ

      public void setZ(com.irurueta.units.Distance z)
      Sets cartesian z coordinate of body position resolved along ECEF-frame axes.
      Parameters:
      z - cartesian z coordinate of body position to be set.
    • setCoordinates

      public void setCoordinates(com.irurueta.units.Distance x, com.irurueta.units.Distance y, com.irurueta.units.Distance z)
      Sets cartesian coordinates of body position and resolved along ECEF-frame axes.
      Parameters:
      x - cartesian x coordinate of body position.
      y - cartesian y coordinate of body position.
      z - cartesian z coordinate of body position.
    • getNorm

      public double getNorm()
      Gets norm of position expressed in meters (m), which represents the distance to Earth's center of mass.
      Returns:
      position norm expressed in meters (m).
    • getNormAsDistance

      public void getNormAsDistance(com.irurueta.units.Distance result)
      Gets norm of position, which represents the distance to Earth's center of mass.
      Parameters:
      result - instance where result will be stored.
    • getNormAsDistance

      public com.irurueta.units.Distance getNormAsDistance()
      Gets norm of position, which represents the distance to Earth's center of mass.
      Returns:
      position norm.
    • copyTo

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

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

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

      public double[] asArray()
      Gets position coordinates expressed in meters (m) as an array.
      Returns:
      array containing position coordinates in x,y,z order.
    • asMatrix

      public void asMatrix(com.irurueta.algebra.Matrix result)
      Gets position coordinates expressed in meters (m) 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 position coordinates expressed in meters (m) as a column matrix.
      Returns:
      position 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 boolean equals(Object o)
      Checks if provided object is an ECEFPosition having exactly the same contents as this instance.
      Overrides:
      equals in class Object
      Parameters:
      o - Object to be compared.
      Returns:
      true if both objects are considered to be equal, false otherwise.
    • equals

      public boolean equals(ECEFPosition 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(ECEFPosition 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 difference allowed between position 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.
    • convertDistance

      private double convertDistance(com.irurueta.units.Distance distance)
      Converts distance instance into meters value.
      Parameters:
      distance - instance to be converted.
      Returns:
      converted value.