|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jzy3d.maths.Coord2d
public class Coord2d
A Coord2d
stores a 2 dimensional coordinate for cartesian (x,y) or
polar (a,r) mode, and provide operators allowing to add, substract,
multiply and divises coordinate values, as well as computing the distance between
two points, and converting polar and cartesian coordinates.
Field Summary | |
---|---|
static Coord2d |
INVALID
An invalid Coord2d has value NaN for each dimension. |
static Coord2d |
ORIGIN
The origin is a Coord2d having value 0 for each dimension. |
float |
x
|
float |
y
|
Constructor Summary | |
---|---|
Coord2d()
Creates a 2d coordinate with the value 0 for each dimension. |
|
Coord2d(double xi,
double yi)
Creates a 2d coordinate. |
|
Coord2d(float xi,
float yi)
Creates a 2d coordinate. |
|
Coord2d(java.awt.geom.Point2D point)
|
Method Summary | |
---|---|
Coord2d |
add(Coord2d c2)
Add a Coord2d to the current one and return the result in a new Coord2d. |
Coord2d |
add(float value)
Add a value to all components of the current Coord and return the result in a new Coord2d. |
Coord2d |
add(float x,
float y)
|
void |
addSelf(Coord2d c2)
|
void |
addSelf(float value)
|
void |
addSelf(float x,
float y)
|
void |
addSelfX(float x)
|
void |
addSelfY(float y)
|
Coord2d |
cartesian()
Converts the current Coord3d into cartesian coordinates and return the result in a new Coord3d. |
Coord2d |
clone()
Return a duplicate of this 3d coordinate. |
java.awt.geom.Point2D |
cloneAsDoublePoint()
|
java.awt.geom.Point2D |
cloneAsFloatPoint()
|
double |
distance(Coord2d c)
Compute the distance between two coordinates. |
double |
distanceSq(Coord2d c)
|
Coord2d |
div(Coord2d c2)
Divise a Coord2d to the current one and return the result in a new Coord2d. |
Coord2d |
div(float value)
Divise all components of the current Coord by the same value and return the result in a new Coord3d. |
Coord2d |
div(float x,
float y)
|
void |
divSelf(float value)
|
boolean |
equals(java.lang.Object o)
|
Coord2d |
fullPolar()
Return a real polar value, with an angle in the range [0;2*PI] http://fr.wikipedia.org/wiki/Coordonn%C3%A9es_polaires |
Coord2d |
interpolation(Coord2d c,
float ratio)
Returns an interpolated point between the current and given point, according to an input ratio in [0;1] that indicates how near to the current point the new point will stand. |
Coord2d |
mul(Coord2d c2)
Multiply a Coord2d to the current one and return the result in a new Coord2d. |
Coord2d |
mul(float value)
Multiply all components of the current Coord and return the result in a new Coord3d. |
Coord2d |
mul(float x,
float y)
|
void |
mulSelf(float value)
|
Coord2d |
polar()
Converts the current Coord2d into polar coordinates
and return the result in a new Coord2d where X indicates
angle, and Y indicates radius. |
void |
set(Coord2d c2)
|
Coord2d |
sub(Coord2d c2)
Substract a Coord2d to the current one and return the result in a new Coord2d. |
Coord2d |
sub(float value)
Substract a value to all components of the current Coord and return the result in a new Coord2d. |
Coord2d |
sub(float x,
float y)
|
void |
subSelf(Coord2d c2)
|
void |
subSelf(float x,
float y)
|
float[] |
toArray()
Return an array representation of this coordinate. |
java.lang.String |
toString()
Return a string representation of this coordinate. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Coord2d ORIGIN
public static final Coord2d INVALID
public float x
public float y
Constructor Detail |
---|
public Coord2d()
public Coord2d(float xi, float yi)
public Coord2d(double xi, double yi)
public Coord2d(java.awt.geom.Point2D point)
Method Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Coord2d clone()
clone
in class java.lang.Object
public java.awt.geom.Point2D cloneAsFloatPoint()
public java.awt.geom.Point2D cloneAsDoublePoint()
public void set(Coord2d c2)
public Coord2d add(Coord2d c2)
c2
-
public void addSelf(Coord2d c2)
public void addSelf(float value)
public void addSelf(float x, float y)
public void addSelfX(float x)
public void addSelfY(float y)
public Coord2d add(float value)
value
-
public Coord2d add(float x, float y)
public Coord2d sub(Coord2d c2)
c2
-
public void subSelf(Coord2d c2)
public void subSelf(float x, float y)
public Coord2d sub(float value)
value
-
public Coord2d sub(float x, float y)
public Coord2d mul(Coord2d c2)
c2
-
public Coord2d mul(float x, float y)
public Coord2d mul(float value)
value
-
public void mulSelf(float value)
public Coord2d div(Coord2d c2)
c2
-
public Coord2d div(float value)
value
-
public Coord2d div(float x, float y)
public void divSelf(float value)
public Coord2d cartesian()
public Coord2d polar()
Coord2d
into polar coordinates
and return the result in a new Coord2d
where X indicates
angle, and Y indicates radius.
Warning: If source X is 0, then output angle is NaN.
Output angle is in [-PI/2; PI/2].
Coord2d.fullPolar()} for an angle value in [0;2*PI]
public Coord2d fullPolar()
public double distance(Coord2d c)
public double distanceSq(Coord2d c)
public Coord2d interpolation(Coord2d c, float ratio)
public java.lang.String toString()
toString
in class java.lang.Object
public float[] toArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |