Class Place


  • public class Place
    extends java.lang.Object
    Specifies a celestial position
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void calcAngles()
      Internal conversion from direction to (alpha, delta)
      double getAlpha()
      Returns the right ascension [rad] of the Place
      double getAngleTo​(Place p)
      Calculates the angle between this Place and another Place
      double getDelta()
      Returns the declination [rad] of the Place
      Vector3d getDirection()
      Returns the unit vector of the Place
      Place moveToRandom​(java.util.Random rnd)
      Moves the current Place to a random position
      Place moveToRandom​(java.util.Random rnd, Place centre, double radius)
      Moves the current Place to a random position within a certain radius of a given Place.
      Place setAngles​(double rightAscension, double declination)
      Sets the position of the Place to given (alpha, delta)
      Place setDirection​(Vector3d r)
      Sets the position of the Place to that of a given vector (need not be a unit vector)
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • haveAngles

        protected boolean haveAngles
      • alpha

        protected double alpha
      • delta

        protected double delta
    • Constructor Detail

      • 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​(java.util.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 Detail

      • 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • moveToRandom

        public Place moveToRandom​(java.util.Random rnd)
        Moves the current Place to a random position
      • moveToRandom

        public Place moveToRandom​(java.util.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)