# Class SkyDistance

java.lang.Object
uk.ac.starlink.ttools.plot2.geom.SkyDistance

public class SkyDistance extends Object
Encapsulates a distance on the sky and a label for its magnitude.

Since:
  21 Jan 2019
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`SkyDistance(double radians, Caption caption)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Caption`
`getCaption()`
Returns the description of this distance.
`double`
`getRadians()`
Returns the distance in radians.
`static SkyDistance`
`getRoundDistance(double rad)`
Returns a distance with a round value in the region of the supplied angle.
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SkyDistance

public SkyDistance(double radians, Caption caption)
Constructor.

Parameters:
  `radians` - distance in radians
  `caption` - annotation giving distance as a human-readable string

## Method Details

### getRadians

public double getRadians()
Returns the distance in radians.

Returns:
  distance in radians

### getCaption

public Caption getCaption()
Returns the description of this distance.

Returns:
  human-readable label indicating distance

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getRoundDistance

public static SkyDistance getRoundDistance(double rad)
Returns a distance with a round value in the region of the supplied angle.

Parameters:
  `rad` - approximate distance in radians
Returns:
  SkyDistance instance with a round number caption