# Class Place

java.lang.Object

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

Fields
Modifier and Type
Field
Description
`protected double`
`alpha`

`protected double`
`delta`

`protected Vector3d`
`dirICRS`

`protected boolean`
`haveAngles`

• ## 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(Random rnd)`
Constructs a Place at a random position
• ## Method Summary

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(Random rnd)`
Moves the current Place to a random position
`Place`
```moveToRandom(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)
`String`
`toString()`

### 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:
• ### getDelta

public double getDelta()
Returns the declination [rad] of the Place
Returns:
• ### 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:
• ### toString

public String toString()
Overrides:
`toString` in class `Object`