Package gaiasky.util.gaia.utils
Class Place
java.lang.Object
gaiasky.util.gaia.utils.Place
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected double
protected Vector3d
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Internal conversion from direction to (alpha, delta)double
getAlpha()
Returns the right ascension [rad] of the Placedouble
getAngleTo
(Place p) Calculates the angle between this Place and another Placedouble
getDelta()
Returns the declination [rad] of the PlaceReturns the unit vector of the PlacemoveToRandom
(Random rnd) Moves the current Place to a random positionmoveToRandom
(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)toString()
-
Field Details
-
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
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
Constructs a Place at a random position- Parameters:
rnd
- Random number generator
-
Place
Duplicates a Place- Parameters:
p
-
-
-
Method Details
-
getDirection
Returns the unit vector of the Place- Returns:
- vector
-
setDirection
Sets the position of the Place to that of a given vector (need not be a unit vector)- Parameters:
r
- 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
Sets the position of the Place to given (alpha, delta)- Parameters:
rightAscension
-declination
-
-
getAngleTo
Calculates the angle between this Place and another Place- Parameters:
p
- the other Place- Returns:
- angle between them [rad]
-
toString
-
moveToRandom
Moves the current Place to a random position -
moveToRandom
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)
-