|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jzy3d.maths.Coord3d
public class Coord3d
A Coord3d stores a 3 dimensional coordinate for cartesian or polar mode, and provide few operators. Operators allow adding, substracting, multiplying and divising coordinate values, as well as computing the distance between two points, and converting polar and cartesian coordinates.
Field Summary | |
---|---|
static Coord3d |
IDENTITY
The origin is a Coord3d having value 1 for each dimension. |
static Coord3d |
INVALID
An invalid Coord2d has value NaN for each dimension. |
static Coord3d |
ORIGIN
The origin is a Coord3d having value 0 for each dimension. |
float |
x
|
float |
y
|
float |
z
|
Constructor Summary | |
---|---|
Coord3d()
Create a 3d coordinate with value 0 for each dimension. |
|
Coord3d(Coord2d c,
float zi)
|
|
Coord3d(Coord3d c2)
|
|
Coord3d(double xi,
double yi,
double zi)
Create a 3d coordinate. |
|
Coord3d(float[] c)
|
|
Coord3d(float xi,
float yi,
float zi)
Create a 3d coordinate. |
Method Summary | |
---|---|
Coord3d |
add(Coord3d c2)
Add a Coord3d to the current one and return the result in a new Coord3d. |
Coord3d |
add(float value)
Add a value to all components of the current Coord and return the result in a new Coord3d. |
Coord3d |
add(float x,
float y,
float z)
|
Coord3d |
addSelf(Coord3d c2)
|
Coord3d |
addSelf(float value)
|
Coord3d |
cartesian()
Converts the current Coord3d into cartesian coordinates and return the result in a new Coord3d. |
Coord3d |
clone()
Return a duplicate of this 3d coordinate. |
double |
distance(Coord3d c)
Compute the distance between two coordinates. |
double |
distanceSq(Coord3d c)
|
Coord3d |
div(Coord3d c2)
Divise a Coord3d to the current one and return the result in a new Coord3d. |
Coord3d |
div(float value)
Divise all components of the current Coord by the same value and return the result in a new Coord3d. |
float |
dot(Coord3d v)
|
boolean |
equals(java.lang.Object aThat)
|
Coord3d |
getNormalizedTo(float len)
|
Coord2d |
getXY()
Return the x and y component as a 2d coordinate. |
int |
hashCode()
|
Coord3d |
interpolateTo(Coord3d v,
float f)
|
float |
magSquared()
|
Coord3d |
mul(Coord3d c2)
Multiply a Coord3d to the current one and return the result in a new Coord3d. |
Coord3d |
mul(float value)
Multiply all components of the current Coord and return the result in a new Coord3d. |
Coord3d |
negative()
|
Coord3d |
normalizeTo(float len)
|
Coord3d |
polar()
Converts the current Coord3d into polar coordinates and return the result in a new Coord3d. |
Coord3d |
set(Coord3d c2)
|
Coord3d |
set(float x,
float y,
float z)
|
Coord3d |
sub(Coord3d c2)
Substract a Coord3d to the current one and return the result in a new Coord3d. |
Coord3d |
sub(float value)
Substract a value to all components of the current Coord and return the result in a new Coord3d. |
Coord3d |
subSelf(Coord3d c2)
|
Coord3d |
subSelf(float value)
|
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, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Coord3d ORIGIN
public static final Coord3d IDENTITY
public static final Coord3d INVALID
public float x
public float y
public float z
Constructor Detail |
---|
public Coord3d()
public Coord3d(float xi, float yi, float zi)
public Coord3d(Coord2d c, float zi)
public Coord3d(float[] c)
public Coord3d(double xi, double yi, double zi)
public Coord3d(Coord3d c2)
Method Detail |
---|
public Coord3d set(Coord3d c2)
public Coord3d set(float x, float y, float z)
public Coord3d clone()
clone
in class java.lang.Object
public Coord2d getXY()
public Coord3d add(Coord3d c2)
c2
-
public Coord3d add(float x, float y, float z)
public Coord3d addSelf(Coord3d c2)
public Coord3d add(float value)
value
-
public Coord3d addSelf(float value)
public Coord3d sub(Coord3d c2)
c2
-
public Coord3d subSelf(Coord3d c2)
public Coord3d sub(float value)
value
-
public Coord3d subSelf(float value)
public Coord3d mul(Coord3d c2)
c2
-
public Coord3d mul(float value)
value
-
public Coord3d div(Coord3d c2)
c2
-
public Coord3d div(float value)
value
-
public Coord3d negative()
public Coord3d cartesian()
public Coord3d polar()
public double distance(Coord3d c)
public double distanceSq(Coord3d c)
public float magSquared()
public Coord3d getNormalizedTo(float len)
public Coord3d normalizeTo(float len)
public final float dot(Coord3d v)
public final Coord3d interpolateTo(Coord3d v, float f)
public java.lang.String toString()
toString
in class java.lang.Object
public float[] toArray()
public boolean equals(java.lang.Object aThat)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |