jsky.coords
Class CoordinateRadius

java.lang.Object
  extended by jsky.coords.CoordinateRadius
All Implemented Interfaces:
java.io.Serializable

public class CoordinateRadius
extends java.lang.Object
implements java.io.Serializable

Represents a generic center coordinate and radius range (or width and height), Some methods are provided to check if another coordinate point lies within the range. The coordinates and radius (or width and height) values are treated in a generic way.

See Also:
Serialized Form

Field Summary
protected  Coordinates centerPosition
          Center position in a supported coordinate system
protected  double height
          Height about the center (optional)
protected  double maxRadius
          Max radius from center
protected  double minRadius
          Min radius from center
protected  double width
          Width about the center (optional)
 
Constructor Summary
CoordinateRadius(Coordinates pos, double maxRadius)
          Initialize from the given center position and radius.
CoordinateRadius(Coordinates pos, double minRadius, double maxRadius)
          Initialize from the given center position and radius range.
CoordinateRadius(Coordinates pos, double maxRadius, double width, double height)
          Initialize from the given center position, width and height.
CoordinateRadius(Coordinates pos, double minRadius, double maxRadius, double width, double height)
          Initialize from the given center position, width and height.
 
Method Summary
 boolean contains(Coordinates pos)
          Return true if the given coordinate position lies within the region defined by this object.
 Coordinates getCenterPosition()
          Return the center position.
 double getHeight()
          Return the height, if set, otherwise 0.
 double getMaxRadius()
          Return the max radius value.
 double getMinRadius()
          Return the min radius value.
 double getWidth()
          Return the width, if set, otherwise 0.
 java.lang.String toString()
          Return coordinates and radius as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

centerPosition

protected Coordinates centerPosition
Center position in a supported coordinate system


minRadius

protected double minRadius
Min radius from center


maxRadius

protected double maxRadius
Max radius from center


width

protected double width
Width about the center (optional)


height

protected double height
Height about the center (optional)

Constructor Detail

CoordinateRadius

public CoordinateRadius(Coordinates pos,
                        double minRadius,
                        double maxRadius)
Initialize from the given center position and radius range. The units of the radius values depend on the type of the coordinates, for example arcmin for world coordinates, pixel for image coordinates.

Parameters:
pos - the center position.
minRadius - the minimum radius from the center position
maxRadius - the maximum radius from the center position

CoordinateRadius

public CoordinateRadius(Coordinates pos,
                        double maxRadius)
Initialize from the given center position and radius. The units of the radius values depend on the type of the coordinates, for example arcmin for world coordinates, pixel for image coordinates.

Parameters:
pos - the center position.
maxRadius - the maximum radius from the center position

CoordinateRadius

public CoordinateRadius(Coordinates pos,
                        double maxRadius,
                        double width,
                        double height)
Initialize from the given center position, width and height. The units of the width and height depend on the type of the coordinates, for example arcmin for world coordinates, pixel for image coordinates.

Parameters:
pos - the center position.
maxRadius - the maximum radius from the center position
width - the width of the image area, about the center
height - the height of the image area, about the center

CoordinateRadius

public CoordinateRadius(Coordinates pos,
                        double minRadius,
                        double maxRadius,
                        double width,
                        double height)
Initialize from the given center position, width and height. The units of the width and height depend on the type of the coordinates, for example arcmin for world coordinates, pixel for image coordinates.

Parameters:
pos - the center position.
width - the width of the image area, about the center
height - the height of the image area, about the center
minRadius - the minimum radius from the center position
maxRadius - the maximum radius from the center position
Method Detail

getCenterPosition

public Coordinates getCenterPosition()
Return the center position.


getMinRadius

public double getMinRadius()
Return the min radius value.


getMaxRadius

public double getMaxRadius()
Return the max radius value.


getWidth

public double getWidth()
Return the width, if set, otherwise 0.


getHeight

public double getHeight()
Return the height, if set, otherwise 0.


contains

public boolean contains(Coordinates pos)
Return true if the given coordinate position lies within the region defined by this object.


toString

public java.lang.String toString()
Return coordinates and radius as a string.

Overrides:
toString in class java.lang.Object