public class ImageCoords extends Object implements Coordinates, Serializable
Modifier and Type | Field and Description |
---|---|
protected double |
x
The X coordinate
|
protected double |
y
The Y coordinate
|
Constructor and Description |
---|
ImageCoords()
Default constructor: initialize null coordinates.
|
ImageCoords(double x,
double y)
Initialize from x and y.
|
ImageCoords(Double x,
Double y)
Initialize from x and y.
|
ImageCoords(String x,
String y) |
Modifier and Type | Method and Description |
---|---|
ImageCoords[] |
box(double radius)
Given a radius, return an array {pos1, pos2} with the 2 endpoints
that form a box with center at "this" position.
|
double[] |
center(ImageCoords pos1,
ImageCoords pos2)
Given the endpoints of a box (pos1, pos2), return an array containing the
center pos, as well as the width, height, and radius of the box.
|
double |
dist(Coordinates pos)
Return the distance between this position and the given one.
|
static double |
dist(double x0,
double y0,
double x1,
double y1)
Return the distance between the two points.
|
double |
dist(ImageCoords pos)
Return the distance between this position and the given one.
|
String |
getCoordinateSystemName()
Returns the name of the coordinate system as a string.
|
double |
getX()
return the X value
|
double |
getY()
return the Y value
|
static void |
main(String[] args)
Test cases
|
String |
toString()
Return the coordinates as a string in h:m:s [+-]d:m:s format
|
public ImageCoords()
public ImageCoords(double x, double y)
x
- The X coordinatey
- The Y coordinatepublic ImageCoords(Double x, Double y)
x
- The X coordinatey
- The Y coordinatepublic double getX()
getX
in interface Coordinates
public double getY()
getY
in interface Coordinates
public String toString()
toString
in interface Coordinates
toString
in class Object
public static double dist(double x0, double y0, double x1, double y1)
x0
- The X coordinate of the first pointy0
- The Y coordinate of the first pointx1
- The X coordinate of the second pointy1
- The Y coordinate of the second pointpublic double dist(ImageCoords pos)
pos
- The other point.public double dist(Coordinates pos)
dist
in interface Coordinates
pos
- The other point.public ImageCoords[] box(double radius)
radius
- The radius.public double[] center(ImageCoords pos1, ImageCoords pos2)
pos1
- The first endpoint of the box.pos1
- The second endpoint of the box.public String getCoordinateSystemName()
getCoordinateSystemName
in interface Coordinates
public static void main(String[] args)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.