|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.geometry.Tuple2D<Coord2D>
org.starhope.appius.geometry.Coord2D
public final class Coord2D
WRITEME: Document this type.
| Field Summary | |
|---|---|
private static long |
serialVersionUID
Java serialisation unique ID |
| Fields inherited from class org.starhope.appius.geometry.Tuple2D |
|---|
x, y |
| Constructor Summary | |
|---|---|
Coord2D(Coord2D c)
Creates a coordinate pair from an existing coordinate pair |
|
Coord2D(double x0,
double y0)
Create a coordinate pair from an x and y value |
|
Coord2D(org.json.JSONObject jso)
Create a Coord2D from a JSON object |
|
| Method Summary | |
|---|---|
double |
distance(Coord2D coord2d)
Gets the distance from this coordinate to the given one |
double |
distance(double x0,
double y0)
Gets the distance from this coordinate to the given one |
protected Coord2D |
newInstance(double x0,
double y0)
Creates a new instance of the coordinate pair for use by the abstract generic parent class to get around downcasting problems |
static Coord2D |
parseCoord2D(String string)
understands (x,y) or x,y forms |
static List<Coord2D> |
parseCoord2D(String[] parts)
|
Coord3D |
toCoord3D()
|
Coord2D |
translate(double dX,
double dY)
Moves the point by the given delta x and y |
| Methods inherited from class org.starhope.appius.geometry.Tuple2D |
|---|
add, add, clone, divide, equals, getX, getY, hashCode, multiply, subtract, subtract, toJSON, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
| Constructor Detail |
|---|
public Coord2D(Coord2D c)
c - other coördinates
public Coord2D(double x0,
double y0)
x0 - x ordinatey0 - y abscissa
public Coord2D(org.json.JSONObject jso)
throws org.json.JSONException
jso - an object with "x" and "y" values
org.json.JSONException - on malformed input| Method Detail |
|---|
public static Coord2D parseCoord2D(String string)
string - WRITEME
public static List<Coord2D> parseCoord2D(String[] parts)
parts - list of coördinates as a string
public double distance(Coord2D coord2d)
coord2d - Target coordinate
public double distance(double x0,
double y0)
x0 - xy0 - y
protected Coord2D newInstance(double x0,
double y0)
newInstance in class Tuple2D<Coord2D>x0 - xy0 - y
Tuple2D.newInstance(double,
double)public Coord3D toCoord3D()
public Coord2D translate(double dX,
double dY)
dX - ΔxdY - Δy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||