Class Place

java.lang.Object
gaiasky.util.gaia.utils.Place

public class Place extends Object
Specifies a celestial position
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
     
    protected double
     
    protected Vector3d
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Place​(double rightAscension, double declination)
    Constructs a Place at given (alpha, delta)
    Place​(Place p)
    Duplicates a Place
    Constructs a Place at the position given by a vector (need not be a unit vector)
    Place​(Random rnd)
    Constructs a Place at a random position
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Internal conversion from direction to (alpha, delta)
    double
    Returns the right ascension [rad] of the Place
    double
    Calculates the angle between this Place and another Place
    double
    Returns the declination [rad] of the Place
    Returns the unit vector of the Place
    Moves the current Place to a random position
    moveToRandom​(Random rnd, Place centre, double radius)
    Moves the current Place to a random position within a certain radius of a given Place.
    setAngles​(double rightAscension, double declination)
    Sets the position of the Place to given (alpha, delta)
    Sets the position of the Place to that of a given vector (need not be a unit vector)
     

    Methods inherited from class java.lang.Object

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

    • dirICRS

      protected Vector3d dirICRS
    • haveAngles

      protected boolean haveAngles
    • alpha

      protected double alpha
    • delta

      protected double delta
  • Constructor Details

    • Place

      public Place()
      Default constructor. Puts the Place at (alpha, delta ) = (0, 0)
    • Place

      public Place(Vector3d r)
      Constructs a Place at the position given by a vector (need not be a unit vector)
      Parameters:
      r - vector
    • Place

      public Place(double rightAscension, double declination)
      Constructs a Place at given (alpha, delta)
      Parameters:
      rightAscension -
      declination -
    • Place

      public Place(Random rnd)
      Constructs a Place at a random position
      Parameters:
      rnd - Random number generator
    • Place

      public Place(Place p)
      Duplicates a Place
      Parameters:
      p -
  • Method Details

    • getDirection

      public Vector3d getDirection()
      Returns the unit vector of the Place
      Returns:
      vector
    • getAlpha

      public double getAlpha()
      Returns the right ascension [rad] of the Place
      Returns:
      The right ascension in radians
    • getDelta

      public double getDelta()
      Returns the declination [rad] of the Place
      Returns:
      The declination in radians
    • setAngles

      public Place setAngles(double rightAscension, double declination)
      Sets the position of the Place to given (alpha, delta)
      Parameters:
      rightAscension -
      declination -
    • setDirection

      public Place setDirection(Vector3d r)
      Sets the position of the Place to that of a given vector (need not be a unit vector)
      Parameters:
      r - vector
    • getAngleTo

      public double getAngleTo(Place p)
      Calculates the angle between this Place and another Place
      Parameters:
      p - the other Place
      Returns:
      angle between them [rad]
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
      Object.toString()
    • moveToRandom

      public Place moveToRandom(Random rnd)
      Moves the current Place to a random position
    • moveToRandom

      public Place moveToRandom(Random rnd, Place centre, double radius)
      Moves the current Place to a random position within a certain radius of a given Place.
    • calcAngles

      protected void calcAngles()
      Internal conversion from direction to (alpha, delta)