|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkeps.math.Tuple3
keps.math.Point3
public class Point3
GENERAL CONTRACT FOR ALL MATH CLASSES. -- The destination of every method is assumed to be the object the method was called on. For example: c.add(a,b) means c = a + b. -- Whenever one operand of a binary operand is missing, it is assumed to be the object the method was called upon. For example: c.add(a) means c = c + a. Class for 3d points.
Field Summary |
---|
Fields inherited from class keps.math.Tuple3 |
---|
x, y, z |
Constructor Summary | |
---|---|
Point3()
Default constructor. |
|
Point3(double newX,
double newY,
double newZ)
The explicit constructor. |
|
Point3(Point3 newTuple)
Copy constructor. |
Method Summary | |
---|---|
void |
add(Point3 point,
Vector3 vector)
Add a Vector3 to a Point3 and store the result in this Point3 |
void |
add(Vector3 vector)
Add a Vector3 to this Point3 |
double |
distance(Point3 other)
Returns the distance from this Point3 to other |
double |
distanceSquared(Point3 other)
Returns the squared distance from this Point3 to other |
void |
scaleAdd(double scale,
Vector3 vector)
Add a scaled multiple of a Vector3 to this Point3 |
void |
sub(Point3 point,
Vector3 vector)
Subtract a Vector3 from a Point3 and store the result in this Point3 |
void |
sub(Vector3 vector)
Subtract a Vector3 to this Point3 |
java.lang.String |
toString()
|
Methods inherited from class keps.math.Tuple3 |
---|
scale, set, set |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Point3()
public Point3(Point3 newTuple)
newTuple
- The Point3 to copy.public Point3(double newX, double newY, double newZ)
newX
- The x value of the new Point3.newY
- The y value of the new Point3.newZ
- The z value of the new Point3.Method Detail |
---|
public double distanceSquared(Point3 other)
other
- another point
public double distance(Point3 other)
other
- another point
public void add(Vector3 vector)
vector
- the Vector3 to addpublic void add(Point3 point, Vector3 vector)
point
- the input pointvector
- the input vectorpublic void sub(Vector3 vector)
vector
- the Vector3 to substractpublic void sub(Point3 point, Vector3 vector)
point
- the input pointvector
- the input vectorpublic void scaleAdd(double scale, Vector3 vector)
scale
- the input scalevector
- the input vectorpublic java.lang.String toString()
toString
in class Tuple3
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |