public class Point3 extends Tuple3
Constructor and Description |
---|
Point3()
Constructs a point with coordinates zero.
|
Point3(double x,
double y,
double z)
Constructs a point with specified coordinates.
|
Point3(Point3 p)
Constructs a copy of the specified point.
|
Point3(Point4 p)
Constructs a point from the specified 4-d point.
|
Modifier and Type | Method and Description |
---|---|
Point3 |
affine(double a,
Point3 q)
Returns an affine combination of this point p and the specified point q.
|
double |
distanceTo(Point3 q)
Returns the distance between this point p and the specified point q.
|
Vector3 |
minus(Point3 q)
Returns the vector v = p-q, for this point p and the specified point q.
|
Point3 |
minus(Vector3 v)
Returns the point q = p-v, for this point p and the specified vector v.
|
Point3 |
minusEquals(Vector3 v)
Moves this point p by subtracting the specified vector v.
|
Point3 |
plus(Vector3 v)
Returns the point q = p+v, for this point p and the specified vector v.
|
Point3 |
plusEquals(Vector3 v)
Moves this point p by adding the specified vector v.
|
public Point3()
public Point3(double x, double y, double z)
x
- the x coordinate.y
- the y coordinate.z
- the z coordinate.public Point3(Point4 p)
p
- the 4-D point.public Point3(Point3 p)
p
- the point.public Point3 plus(Vector3 v)
v
- the vector v.public Point3 minus(Vector3 v)
v
- the vector v.public Vector3 minus(Point3 q)
q
- the point q.public Point3 plusEquals(Vector3 v)
v
- the vector v.public Point3 minusEquals(Vector3 v)
v
- the vector v.public Point3 affine(double a, Point3 q)
a
- the weight of the point q.q
- the point q.public double distanceTo(Point3 q)
q
- the point.