Class Coordinates

java.lang.Object
gaiasky.util.coord.Coordinates

public class Coordinates extends Object
  • Field Details Link icon

    • OBLIQUITY_DEG_J2000 Link icon

      public static final double OBLIQUITY_DEG_J2000
      Obliquity for low precision calculations in degrees and radians. J2000 with T=0
      See Also:
    • OBLIQUITY_RAD_J2000 Link icon

      public static final double OBLIQUITY_RAD_J2000
    • OBLIQUITY_ARCSEC_J2000 Link icon

      public static final double OBLIQUITY_ARCSEC_J2000
      Obliquity of ecliptic in J2000 in arcsec
      See Also:
  • Constructor Details Link icon

    • Coordinates Link icon

      public Coordinates()
  • Method Details Link icon

    • getMap Link icon

      public static Map<String,Matrix4D> getMap()
    • getRotationMatrix Link icon

      public static Matrix4D getRotationMatrix(double alpha, double beta, double gamma)
      Gets the rotation matrix to apply for the given Euler angles α, β and γ. It applies Ry(γ)*Rz(β)*Ry(α), so that it rotates the fixed xyz system to make it coincide with the XYZ, where α is the angle between the axis z and the line of nodes N, β is the angle between the y axis and the Y axis, and γ is the angle between the Z axis and the line of nodes N.
      The assumed reference system is as follows:
      • ZX is the fundamental plane.
      • Z points to the origin of the reference plane (the line of nodes N).
      • Y points upwards.
      Parameters:
      alpha - The α angle in degrees, between z and N.
      beta - The β angle in degrees, between y and Y.
      gamma - The γ angle in degrees, Z and N.
      Returns:
      The rotation matrix.
    • eclToEq Link icon

      public static Matrix4D eclToEq()
      Gets the rotation matrix to transform equatorial to the ecliptic coordinates. Since the zero point in both systems is the same (the vernal equinox, γ, defined as the intersection between the equator and the ecliptic), α and γ are zero. β, the angle between the up directions of both systems, is precisely the obliquity of the ecliptic, ε. So we have the Euler angles α=0°, β=ε;, γ=0°.
      Returns:
      The matrix to transform from equatorial coordinates to ecliptic coordinates.
    • eclipticToEquatorial Link icon

      public static Matrix4D eclipticToEquatorial()
    • eclToEqF Link icon

      public static com.badlogic.gdx.math.Matrix4 eclToEqF()
    • eclipticToEquatorialF Link icon

      public static com.badlogic.gdx.math.Matrix4 eclipticToEquatorialF()
    • eclToEq Link icon

      public static Matrix4D eclToEq(double julianDate)
      Gets the rotation matrix to transform from the ecliptic system to the equatorial system. See equatorialToEcliptic() for more information, for this is the inverse transformation.
      Returns:
      The transformation matrix.
    • eclipticToEquatorial Link icon

      public static Matrix4D eclipticToEquatorial(double jd)
    • eqToEcl Link icon

      public static Matrix4D eqToEcl()
      Gets the rotation matrix to transform from the ecliptic system to the equatorial system. See eclToEq() for more information, for this is the inverse transformation.
      Returns:
      The transformation matrix.
    • equatorialToEcliptic Link icon

      public static Matrix4D equatorialToEcliptic()
    • eqToEclF Link icon

      public static com.badlogic.gdx.math.Matrix4 eqToEclF()
    • equatorialToEclipticF Link icon

      public static com.badlogic.gdx.math.Matrix4 equatorialToEclipticF()
    • eqToEcl Link icon

      public static Matrix4D eqToEcl(double julianDate)
      Gets the rotation matrix to transform equatorial to the ecliptic coordinates. Since the zero point in both systems is the same (the vernal equinox, γ, defined as the intersection between the equator and the ecliptic), α and γ are zero. β, the angle between the up directions of both systems, is precisely the obliquity of the ecliptic, ε. So we have the Euler angles α=0°, β=ε;, γ=0°.
      Returns:
      The matrix to transform from equatorial coordinates to ecliptic coordinates.
    • equatorialToEcliptic Link icon

      public static Matrix4D equatorialToEcliptic(double jd)
    • galToEq Link icon

      public static Matrix4D galToEq()
      Gets the rotation matrix to transform from the galactic system to the equatorial system. See galacticToEquatorial() for more information, since this is the inverse transformation. Use this matrix if you need to convert equatorial cartesian coordinates to galactic cartesian coordinates.
      Returns:
      The transformation matrix.
    • galacticToEquatorial Link icon

      public static Matrix4D galacticToEquatorial()
    • galToEqF Link icon

      public static com.badlogic.gdx.math.Matrix4 galToEqF()
    • galacticToEquatorialF Link icon

      public static com.badlogic.gdx.math.Matrix4 galacticToEquatorialF()
    • eqToGal Link icon

      public static Matrix4D eqToGal()
      Gets the rotation matrix to transform equatorial to galactic coordinates. The inclination of the galactic equator to the celestial equator is 62.9°. The intersection, or node line, of the two equators is at RA=282.25° DEC=0° and l=33° b=0°. So we have the Euler angles α=-33°, β=62.9°, γ=282.25°.
      Returns:
      The transformation matrix.
    • equatorialToGalactic Link icon

      public static Matrix4D equatorialToGalactic()
    • eqToGalF Link icon

      public static com.badlogic.gdx.math.Matrix4 eqToGalF()
    • equatorialToGalacticF Link icon

      public static com.badlogic.gdx.math.Matrix4 equatorialToGalacticF()
    • equatorialToGalactic Link icon

      public static Vector2D equatorialToGalactic(double alpha, double delta, Vector2D out)
      Transforms from spherical equatorial coordinates to spherical galactic coordinates.
      Parameters:
      alpha - The right ascension in radians.
      delta - The declination in radians.
      out - The out vector.
      Returns:
      The out vector with the galactic longitude and latitude, in radians.
    • galacticToEquatorial Link icon

      public static Vector2D galacticToEquatorial(double l, double b, Vector2D out)
      Transforms from spherical galactic coordinates to spherical equatorial coordinates.
      Parameters:
      l - The galactic longitude in radians.
      b - The galactic latitude in radians.
      out - The out vector.
      Returns:
      The out vector with the right ascension and declination, in radians.
    • eclipticToEquatorial Link icon

      public static Vector2D eclipticToEquatorial(Vector2D vec, Vector2D out)
      Transforms from spherical ecliptic coordinates to spherical equatorial coordinates.
      Parameters:
      vec - Vector with ecliptic longitude (λ) and ecliptic latitude (β) in radians.
      out - The output vector.
      Returns:
      The output vector with ra (α) and dec (δ) in radians, for chaining.
    • eclipticToEquatorial Link icon

      public static Vector2D eclipticToEquatorial(double lambda, double beta, Vector2D out)
      Transforms from spherical ecliptic coordinates to spherical equatorial coordinates.
      Parameters:
      lambda - Ecliptic longitude (λ) in radians.
      beta - Ecliptic latitude (β) in radians.
      out - The output vector.
      Returns:
      The output vector with ra (α) and dec (δ) in radians, for chaining.
    • eclipticToGalactic Link icon

      public static Matrix4D eclipticToGalactic()
    • eclipticToGalacticF Link icon

      public static com.badlogic.gdx.math.Matrix4 eclipticToGalacticF()
    • galacticToEcliptic Link icon

      public static Matrix4D galacticToEcliptic()
    • galacticToEclipticF Link icon

      public static com.badlogic.gdx.math.Matrix4 galacticToEclipticF()
    • sphericalToCartesian Link icon

      public static Vector3D sphericalToCartesian(Vector3D vec, Vector3D out)
      Converts from spherical to Cartesian coordinates, given a longitude (α), a latitude (δ) and the radius. The result is in the XYZ space, where ZX is the fundamental plane, with Z pointing to the the origin of coordinates (equinox) and Y pointing to the north pole.
      Parameters:
      vec - Vector containing the spherical coordinates.
      1. The longitude or right ascension (α), from the Z direction to the X direction, in radians.
      2. The latitude or declination (δ), in radians.
      3. The radius or distance to the point.
      out - The output vector.
      Returns:
      Output vector in Cartesian coordinates where x and z are on the horizontal plane and y is in the up direction.
    • sphericalToCartesian Link icon

      public static Vector3Q sphericalToCartesian(Vector3Q vec, Vector3Q out)
    • sphericalToCartesian Link icon

      public static Vector3D sphericalToCartesian(double longitude, double latitude, double radius, Vector3D out)
      Converts from spherical to Cartesian coordinates, given a longitude (α), a latitude (δ) and the radius.
      Parameters:
      longitude - The longitude or right ascension angle, from the z direction to the x direction, in radians.
      latitude - The latitude or declination, in radians.
      radius - The radius or distance to the point.
      out - The output vector.
      Returns:
      Output vector with the Cartesian coordinates[x, y, z] where x and z are on the horizontal plane and y is in the up direction, for chaining.
    • sphericalToCartesian Link icon

      public static Vector3Q sphericalToCartesian(double longitude, double latitude, Quadruple radius, Vector3Q out)
      Converts from spherical to Cartesian coordinates, given a longitude (α), a latitude (δ) and the radius.
      Parameters:
      longitude - The longitude or right ascension angle, from the z direction to the x direction, in radians.
      latitude - The latitude or declination, in radians.
      radius - The radius or distance to the point.
      out - The output vector.
      Returns:
      Output vector with the Cartesian coordinates[x, y, z] where x and z are on the horizontal plane and y is in the up direction, for chaining.
    • cartesianToSpherical Link icon

      public static Vector3D cartesianToSpherical(Vector3D vec, Vector3D out)
      Converts from Cartesian coordinates to spherical coordinates.
      Parameters:
      vec - Vector with the Cartesian coordinates[x, y, z] where x and z are on the horizontal plane and y is in the up direction.
      out - Output vector.
      Returns:
      Output vector containing the spherical coordinates.
      1. The longitude or right ascension (α), from the z direction to the x direction.
      2. The latitude or declination (δ).
      3. The radius or distance to the point.
    • cartesianToSpherical Link icon

      public static Vector3D cartesianToSpherical(Vector3Q vec, Vector3D out)
      Converts from Cartesian coordinates to spherical coordinates.
      Parameters:
      vec - Vector with the Cartesian coordinates[x, y, z] where x and z are on the horizontal plane and y is in the up direction.
      out - Output vector.
      Returns:
      Output vector containing the spherical coordinates.
      1. The longitude or right ascension (α), from the z direction to the x direction.
      2. The latitude or declination (δ).
      3. The radius or distance to the point.
    • cartesianToSpherical Link icon

      public static Vector3Q cartesianToSpherical(Vector3Q vec, Vector3Q out)
      Converts from Cartesian coordinates to spherical coordinates.
      Parameters:
      vec - Vector with the Cartesian coordinates[x, y, z] where x and z are on the horizontal plane and y is in the up direction.
      out - Output vector.
      Returns:
      Output vector containing the spherical coordinates.
      1. The longitude or right ascension (α), from the z direction to the x direction.
      2. The latitude or declination (δ).
      3. The radius or distance to the point.
    • properMotionsToCartesian Link icon

      public static Vector3D properMotionsToCartesian(double muAlphaStar, double muDelta, double radVel, double ra, double dec, double distPc, Vector3D out)
      Converts proper motions + radial velocity into a cartesian vector. See this article.
      Parameters:
      muAlphaStar - Mu alpha star, in mas/yr.
      muDelta - Mu delta, in mas/yr.
      radVel - Radial velocity in km/s.
      ra - Right ascension in radians.
      dec - Declination in radians.
      distPc - Distance in parsecs to the star.
      Returns:
      The proper motion vector in internal_units/year.
    • cartesianToProperMotions Link icon

      public static Vector3D cartesianToProperMotions(double vx, double vy, double vz, double ra, double dec, double distPc, Vector3D out)
      Converts a cartesian velocity vector [vx,vy,vz] into proper motions + radial velocity. See this article.
      Parameters:
      vx - The X component of the cartesian velocity vector in internal_units/year.
      vy - The Y component of the cartesian velocity vector internal_units/year.
      vz - The Z component of the cartesian velocity vector internal_units/year.
      ra - Right ascension in radians.
      dec - Declination in radians.
      distPc - Distance in parsecs to the star.
      Returns:
      The proper motions (muAlpha, muDelta) in mas/yr, and the radial velocity in km/s.
    • getTransformD Link icon

      public static Matrix4D getTransformD(String name)
    • getTransformF Link icon

      public static com.badlogic.gdx.math.Matrix4 getTransformF(String name)
    • idt Link icon

      public static Matrix4D idt()
    • idtF Link icon

      public static com.badlogic.gdx.math.Matrix4 idtF()