public final class Position extends java.lang.Object implements XYLocation
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
valid |
(package private) double |
x |
(package private) double |
y |
Constructor and Description |
---|
Position() |
Position(double px,
double py) |
Position(XYLocation p) |
Modifier and Type | Method and Description |
---|---|
void |
absolutize(Position porig,
double scale,
Position prel) |
void |
add(Position p) |
static Position |
aXPlusBY(double a,
Position v,
double b,
Position w) |
Position |
copy() |
double |
distanceFrom(Position p) |
double |
distanceFromOrigin() |
Position |
getRelativeToBoxCenter(double[] xyxy) |
double |
getX() |
double |
getY() |
boolean |
isValid() |
static Position |
midpoint(Position pa,
Position pb) |
void |
relativize(Position porig,
double scale,
Position pabs) |
private void |
reportInValid() |
void |
rotateAbout(Position pcen,
double rad) |
void |
rotateBy(double rad) |
private void |
rotateCosSin(double c,
double s) |
void |
rotateTo(Direction dir) |
void |
set(double px,
double py) |
void |
set(XYLocation p) |
void |
setX(double d) |
void |
setY(double d) |
void |
shift(double dx,
double dy) |
void |
shift(Position spos) |
void |
subtract(Position p) |
java.lang.String |
toString() |
public Position()
public Position(XYLocation p)
public Position(double px, double py)
public java.lang.String toString()
toString
in class java.lang.Object
public void set(XYLocation p)
public void add(Position p)
public void subtract(Position p)
private void reportInValid()
public void set(double px, double py)
public double getX()
getX
in interface XYLocation
public double getY()
getY
in interface XYLocation
public void shift(double dx, double dy)
public void shift(Position spos)
public boolean isValid()
public Position copy()
public double distanceFrom(Position p)
public double distanceFromOrigin()
public Position getRelativeToBoxCenter(double[] xyxy)
public void setX(double d)
public void setY(double d)
public void rotateBy(double rad)
private void rotateCosSin(double c, double s)
public void rotateTo(Direction dir)
public void rotateAbout(Position pcen, double rad)
Copyright © 2013. All Rights Reserved.