Class Angle$

java.lang.Object
csw.params.core.models.Angle$
All Implemented Interfaces:
Serializable

public class Angle$ extends Object implements Serializable
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Angle$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assertDe(double de)
     
    void
    assertRa(double ra)
     
    protected long
     
    double
    D2H()
    multiply to convert degrees to archours
    int
    D2M()
    multiply to convert degrees to arcminute
    int
    multiply to convert degrees to milliarcseconds
    double
    D2R()
    multiply to convert degrees to radians
    int
    D2S()
    multiply to convert degrees to arcsecond
    long
    multiply to convert degrees to microarcseconds
    char
    round circle which marks degrees
    deToString(double de2, boolean withColon)
    Converts DE to a string in the format 01:02:03.333 (or '1d 2m 3.333s)' Minutes and seconds are auto added as needed.
    double
    distance(double ra1, double de1, double ra2, double de2)
    calculate great circle distance of two points, coordinates are given in radians
    double2angle(double d)
     
    double
    H2D()
    multiply to convert archour to degrees
    int
    multiply to convert hours to milliarcseconds
    double
    H2R()
    multiply to convert hours to radians
    long
    multiply to convert hours to microarcseconds
    int
    multiply to convert time minutes to milliarcseconds
    long
    multiply to convert time minutes to microarcseconds
    int
    multiply to convert time seconds to milliarcseconds
    long
    multiply to convert time seconds to microarcseconds
    int2angle(int d)
     
    long2angle(long d)
     
    double
    M2D()
    multiply to convert arcminute to toDegree
    int
    multiply to convert minutes to milliarcseconds
    double
    M2R()
    multiply to convert minutes to radians
    long
    multiply to convert minutes to microarcseconds
    double
    multiply to convert milliarcseconds to radians
    max(Angle a1, Angle a2)
    returns maximal angle from two options
    min(Angle a1, Angle a2)
    returns minimal angle from two options
    double
    normalizeRa(double ra2)
    normalize RA into 0 - 2 * PI range
    Tries to parse Angle from string.
    parseDe(String deSign, String deDegree, String deMin, String deSec)
    Parse Declination from four values.
    Tries to parse Angle from string.
    parseRa(String raHour, String raMin, String raSec)
    parse Right ascencion from triple values raHour raMin, raSec This method uses big decimal, so there are no rounding errors
    scala.Tuple2<Angle,Angle>
    Parses pair of RA and De coordinates.
    double
    R2D()
    multiply to convert radians to degrees
    double
    R2H()
    multiply to convert radians to hours
    double
    R2M()
    multiply to convert radians to minutes
    double
    multiply to convert radians to milliarcseconds
    double
    R2S()
    multiply to convert radians to arcseconds
    double
    multiply to convert radians to microarcseconds
    returns random angle with value between -PI/2 and + PI/2
    returns random angle with value between 0 and 2*PI
    raToString(double ra, boolean withColon)
    Converts RA to a string in the format 01:02:03.333 (or '1h 2m 3.33s').
    double
    S2D()
    multiply to convert arcsecond to toDegree
    int
    multiply to convert Seconds to milliarcseconds
    double
    S2R()
    multiply to convert arcseconds to radians
    long
    multiply to convert Seconds to microarcseconds
    double
    multiply to convert UAS to degrees
    double
    multiply to convert UAS to minutes
    double
    multiply to convert microarcseconds to radians
    double
    multiply to convert UAS to Seconds

    Methods inherited from class java.lang.Object

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

    • MODULE$

      public static final Angle$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • Angle$

      public Angle$()
  • Method Details

    • CIRCLE

      protected long CIRCLE()
    • long2angle

      public Angle.AngleWrapperDouble long2angle(long d)
    • int2angle

      public Angle.AngleWrapperDouble int2angle(int d)
    • double2angle

      public Angle.AngleWrapperDouble double2angle(double d)
    • randomRa

      public Angle randomRa()
      returns random angle with value between 0 and 2*PI
    • randomDe

      public Angle randomDe()
      returns random angle with value between -PI/2 and + PI/2
    • max

      public Angle max(Angle a1, Angle a2)
      returns maximal angle from two options
    • min

      public Angle min(Angle a1, Angle a2)
      returns minimal angle from two options
    • parseDe

      public Angle parseDe(String deSign, String deDegree, String deMin, String deSec)
      Parse Declination from four values. It uses BigDecimal, so there are no rounding errors

      Parameters:
      deSign - signum (ie + or -)
      deDegree - declination in degrees
      deMin - remaining part in arcminutes
      deSec - remaining part in arcseconds
      Returns:
      declination in microarcseconds
    • parseDe

      public Angle parseDe(String de)
      Tries to parse Angle from string. It knows common formats used for Declination
      Parameters:
      de - (undocumented)
      Returns:
      (undocumented)
    • parseRa

      public Angle parseRa(String raHour, String raMin, String raSec)
      parse Right ascencion from triple values raHour raMin, raSec This method uses big decimal, so there are no rounding errors

      Parameters:
      raHour - ra hours value as String
      raMin - ra minutes value as String
      raSec - ra seconds value as String
      Returns:
      result in microarcseconds
    • parseRa

      public Angle parseRa(String ra)
      Tries to parse Angle from string. It knows common formats used for Right ascencion (including hours)
      Parameters:
      ra - (undocumented)
      Returns:
      (undocumented)
    • parseRaDe

      public scala.Tuple2<Angle,Angle> parseRaDe(String str)
      Parses pair of RA and De coordinates. This method should handle formats used in vizier. An example: The following writings are allowed:
       20 54 05.689 +37 01 17.38, 10:12:45.3-45:17:50, 15h17m-11d10m, 15h17+89d15, 275d11m15.6954s+17d59m59.876s
       12.34567h-17.87654d, 350.123456d-17.33333d <=> 350.123456 -17.33333
       
      Parameters:
      str - (undocumented)
      Returns:
      (undocumented)
    • normalizeRa

      public double normalizeRa(double ra2)
      normalize RA into 0 - 2 * PI range
      Parameters:
      ra2 - (undocumented)
      Returns:
      (undocumented)
    • assertRa

      public void assertRa(double ra)
    • assertDe

      public void assertDe(double de)
    • raToString

      public String raToString(double ra, boolean withColon)
      Converts RA to a string in the format 01:02:03.333 (or '1h 2m 3.33s'). Minutes and seconds are auto added as needed.

      Parameters:
      ra - in radians
      withColon - if true format as hh:mm:ss.sss, otherwise XXh XXm XXs
      Returns:
      ra in string form
    • deToString

      public String deToString(double de2, boolean withColon)
      Converts DE to a string in the format 01:02:03.333 (or '1d 2m 3.333s)' Minutes and seconds are auto added as needed.

      Parameters:
      de2 - in radians
      withColon - if true format as dd:mm:ss.sss, otherwise XXd XXm XXs
      Returns:
      de in string form
    • distance

      public double distance(double ra1, double de1, double ra2, double de2)
      calculate great circle distance of two points, coordinates are given in radians

      Parameters:
      ra1 - (undocumented)
      de1 - (undocumented)
      ra2 - (undocumented)
      de2 - (undocumented)
      Returns:
      distance of two points in radians
    • D2R

      public double D2R()
      multiply to convert degrees to radians
    • R2D

      public double R2D()
      multiply to convert radians to degrees
    • D2H

      public double D2H()
      multiply to convert degrees to archours
    • H2D

      public double H2D()
      multiply to convert archour to degrees
    • D2M

      public int D2M()
      multiply to convert degrees to arcminute
    • M2D

      public double M2D()
      multiply to convert arcminute to toDegree
    • D2S

      public int D2S()
      multiply to convert degrees to arcsecond
    • S2D

      public double S2D()
      multiply to convert arcsecond to toDegree
    • H2R

      public double H2R()
      multiply to convert hours to radians
    • R2H

      public double R2H()
      multiply to convert radians to hours
    • R2M

      public double R2M()
      multiply to convert radians to minutes
    • M2R

      public double M2R()
      multiply to convert minutes to radians
    • Mas2R

      public double Mas2R()
      multiply to convert milliarcseconds to radians
    • Uas2R

      public double Uas2R()
      multiply to convert microarcseconds to radians
    • R2Mas

      public double R2Mas()
      multiply to convert radians to milliarcseconds
    • R2Uas

      public double R2Uas()
      multiply to convert radians to microarcseconds
    • H2Mas

      public int H2Mas()
      multiply to convert hours to milliarcseconds
    • HMin2Mas

      public int HMin2Mas()
      multiply to convert time minutes to milliarcseconds
    • HSec2Mas

      public int HSec2Mas()
      multiply to convert time seconds to milliarcseconds
    • H2Uas

      public long H2Uas()
      multiply to convert hours to microarcseconds
    • HMin2Uas

      public long HMin2Uas()
      multiply to convert time minutes to microarcseconds
    • HSec2Uas

      public long HSec2Uas()
      multiply to convert time seconds to microarcseconds
    • D2Mas

      public int D2Mas()
      multiply to convert degrees to milliarcseconds
    • M2Mas

      public int M2Mas()
      multiply to convert minutes to milliarcseconds
    • S2Mas

      public int S2Mas()
      multiply to convert Seconds to milliarcseconds
    • D2Uas

      public long D2Uas()
      multiply to convert degrees to microarcseconds
    • M2Uas

      public long M2Uas()
      multiply to convert minutes to microarcseconds
    • S2Uas

      public long S2Uas()
      multiply to convert Seconds to microarcseconds
    • Uas2D

      public double Uas2D()
      multiply to convert UAS to degrees
    • Uas2M

      public double Uas2M()
      multiply to convert UAS to minutes
    • Uas2S

      public double Uas2S()
      multiply to convert UAS to Seconds
    • S2R

      public double S2R()
      multiply to convert arcseconds to radians
    • R2S

      public double R2S()
      multiply to convert radians to arcseconds
    • DEGREE_SIGN

      public char DEGREE_SIGN()
      round circle which marks degrees