Options
All
  • Public
  • Public/Protected
  • All
Menu

Based on the CSW Angle class.

An wrapper for angle. Normally angle would be stored in double as radians, but this introduces rounding errors. This class stores value in microarcseconds to prevent rounding errors.

Hierarchy

  • Angle

Index

Constructors

  • new Angle(uas: number): Angle

Properties

uas: number
CIRCLE: number = ...
D2H: number = ...

multiply to convert degrees to archours

D2M: number = 60

multiply to convert degrees to arcminute

D2Mas: number = ...

multiply to convert degrees to milliarcseconds

D2R: number = ...

multiply to convert degrees to radians

D2S: number = 3600

multiply to convert degrees to arcsecond

D2Uas: number = ...

multiply to convert degrees to microarcseconds

DEGREE_SIGN: "°" = '\u00B0'

round circle which marks degrees

H2D: number = ...

multiply to convert archour to degrees

H2Mas: number = ...

multiply to convert hours to milliarcseconds

H2R: number = ...

multiply to convert hours to radians

H2Uas: number = ...

multiply to convert hours to microarcseconds

HMin2Mas: number = ...

multiply to convert time minutes to milliarcseconds

HMin2Uas: number = ...

multiply to convert time minutes to microarcseconds

HSec2Mas: number = ...

multiply to convert time seconds to milliarcseconds

HSec2Uas: number = ...

multiply to convert time seconds to microarcseconds

M2D: number = ...

multiply to convert arcminute to toDegree

M2Mas: number = ...

multiply to convert minutes to milliarcseconds

M2R: number = ...

multiply to convert minutes to radians

M2Uas: number = ...

multiply to convert minutes to microarcseconds

Mas2R: number = ...

multiply to convert milliarcseconds to radians

R2D: number = ...

multiply to convert radians to degrees

R2H: number = ...

multiply to convert radians to hours

R2M: number = ...

multiply to convert radians to minutes

R2Mas: number = ...

multiply to convert radians to milliarcseconds

R2S: number = ...

multiply to convert radians to arcseconds

R2Uas: number = ...

multiply to convert radians to microarcseconds

S2D: number = ...

multiply to convert arcsecond to toDegree

S2Mas: number = 1000

multiply to convert Seconds to milliarcseconds

S2R: number = ...

multiply to convert arcseconds to radians

S2Uas: number = ...

multiply to convert Seconds to microarcseconds

Uas2D: number = ...

multiply to convert UAS to degrees

Uas2M: number = ...

multiply to convert UAS to minutes

Uas2R: number = ...

multiply to convert microarcseconds to radians

Uas2S: number = ...

multiply to convert UAS to Seconds

Methods

  • toArcSec(): number
  • toDegree(): number
  • toJSON(): number
  • toMas(): number
  • toRadian(): number
  • assertDe(de: number): void
  • assertRa(ra: number): void
  • deToString(de2: number, withColon?: boolean): string
  • convert DE to string in format '1d 2m' minutes and seconds are auto added as needed

    Parameters

    • de2: number

      in radians

    • withColon: boolean = true

      if true format as hh:mm:ss.sss, otherwise XXh XXm XXs

    Returns string

    de in string form

  • distance(ra1: number, de1: number, ra2: number, de2: number): number
  • calculate great circle distance of two points, coordinates are given in radians

    Parameters

    • ra1: number
    • de1: number
    • ra2: number
    • de2: number

    Returns number

    distance of two points in radians

  • fromArcHour(value: number): Angle
  • fromArcMinute(value: number): Angle
  • fromArcSec(value: number): Angle
  • fromDegree(value: number): Angle
  • fromMas(value: number): Angle
  • fromRadian(value: number): Angle
  • normalizeRa(ra2: number): number
  • parseDe(deSign: string, deDegree: string, deMin: string, deSec: null | string): Angle
  • Parse Declination from four values. It uses Big, so there are no rounding errors

    Parameters

    • deSign: string

      signum (ie + or -)

    • deDegree: string

      declination in degrees

    • deMin: string

      remaining part in arcminutes

    • deSec: null | string

      remaining part in arcseconds

    Returns Angle

    declination in microarcseconds

  • parseDeFromString(de: string): Angle
  • parseRa(raHour: string, raMin: string, raSec: null | string): Angle
  • parse Right ascencion from triple values raHour raMin, raSec This method uses big decimal, so there are no rounding errors

    Parameters

    • raHour: string

      ra hours value as string

    • raMin: string

      ra minutes value as string

    • raSec: null | string

      ra seconds value as string

    Returns Angle

    result in microarcseconds

  • 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: string

    Returns [Angle, Angle]

  • parseRaFromString(ra: string): Angle
  • Tries to parse Angle from string. It knows common formats used for Right ascencion (including hours)

    Parameters

    • ra: string

    Returns Angle

  • raToString(ra: number, withColon?: boolean): string
  • convert RA to string in format '1h 2m' minutes and seconds are auto added as needed

    Parameters

    • ra: number

      in radians

    • withColon: boolean = true

      if true format as hh:mm:ss.sss, otherwise XXh XXm XXs

    Returns string

    ra in string form

Generated using TypeDoc