public final class Vector3D
extends java.lang.Object
dxfviewer.math.Point3D;
Constructor and Description |
---|
Vector3D() |
Vector3D(double xx,
double yy,
double zz) |
Vector3D(Point3D p)
Copy from a point.
|
Vector3D(Vector3D v)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Vector3D v)
Add a vector.
|
Vector3D |
cross(Vector3D v)
Cross product.
|
double |
length()
Calculate the length.
|
Point3D |
minus(Point3D p)
Get difference with point.
|
Vector3D |
minus(Vector3D v)
Get difference with vector.
|
double |
mult(Vector3D v)
Scalar product.
|
void |
normalize()
Normalize.
|
Point3D |
plus(Point3D p)
Get sum of this vector and point.
|
Vector3D |
plus(Vector3D v)
Get sum of vectors.
|
void |
scale(double f)
Scale.
|
void |
sub(Vector3D v)
Substract a vector from this.
|
java.lang.String |
toString()
Output.
|
public Vector3D()
public Vector3D(Vector3D v)
v
- vector to copypublic Vector3D(Point3D p)
p
- point to copypublic Vector3D(double xx, double yy, double zz)
xx
- x coordyy
- y coordzz
- z coordpublic double length()
public void scale(double f)
f
- scaling factorpublic void normalize()
public void add(Vector3D v)
v
- vector to addpublic Vector3D plus(Vector3D v)
v
- vector to addpublic Point3D plus(Point3D p)
p
- point to addpublic void sub(Vector3D v)
v
- vector to substractpublic Point3D minus(Point3D p)
p
- point to substractpublic Vector3D minus(Vector3D v)
v
- vector to substractpublic double mult(Vector3D v)
v
- vector to multiplypublic Vector3D cross(Vector3D v)
v
- vector to multiplypublic java.lang.String toString()
toString
in class java.lang.Object