public interface Vector3d
Modifier and Type | Field and Description |
---|---|
static Vector3d |
NEG_UNIT_X
The vector (-1, 0, 0).
|
static Vector3d |
NEG_UNIT_Y
The vector (0, -1, 0).
|
static Vector3d |
NEG_UNIT_Z
The vector (0, 0, -1).
|
static Vector3d |
UNIT_X
The vector (1, 0, 0).
|
static Vector3d |
UNIT_Y
The vector (0, 1, 0).
|
static Vector3d |
UNIT_Z
The vector (0, 0, 1).
|
static Vector3d |
ZERO
The vector (0, 0, 0).
|
Modifier and Type | Method and Description |
---|---|
MVector3d |
add(Vector3d vector)
Returns the sum of this vector and the given vector.
|
double |
angle(Vector3d vector)
Returns the angle in radians between this vector and the given vector.
|
static MVector3d |
centroidOf(Collection<? extends Vector3d> vectors)
Returns the centroid (the average vector) of the given collection of
vectors.
|
static Vector3d |
create(double x,
double y,
double z)
Returns a new vector with the given component values.
|
static Vector3d |
create(Vector3d vector)
Returns a new vector with the component values of the given vector.
|
MVector3d |
crossProduct(Vector3d vector)
Returns the cross product of this vector and the given vector.
|
double |
distance(Vector3d vector)
Returns the distance between this vector and the given vector.
|
double |
distanceSquared(Vector3d vector)
Returns the squared distance between this vector and the given vector.
|
double |
dotProduct(Vector3d vector)
Returns the dot product of this vector and the given vector.
|
boolean |
equalsWithTolerance(Vector3d vector,
double tolerance)
Returns true if this vector is within tolerance of the given vector.
|
double |
getLength()
Returns the length of this vector.
|
double |
getLengthSquared()
Returns the squared length of this vector.
|
double |
getX()
Returns the X component of this vector.
|
double |
getY()
Returns the Y component of this vector.
|
double |
getZ()
Returns the Z component of this vector.
|
MVector3d |
interpolate(Vector3d vector,
double alpha)
Interpolates linearly between this vector and the given vector and returns the resulting vector.
|
MVector3d |
negate()
Returns a negated copy of this vector.
|
MVector3d |
normalize()
Returns a normalized copy of this vector.
|
Optional<Vector3d> |
project(Vector3d vector)
Returns an orthogonal projection of this vector on the given vector if it exists.
|
MVector3d |
scale(double scalar)
Returns a copy of this vector scaled by the given scalar.
|
MVector3d |
subtract(Vector3d vector)
Returns the difference between this vector and the given vector.
|
MVector2d |
to2dVector()
Returns this vector projected onto the XY-plane.
|
static final Vector3d ZERO
static final Vector3d UNIT_X
static final Vector3d NEG_UNIT_X
static final Vector3d UNIT_Y
static final Vector3d NEG_UNIT_Y
static final Vector3d UNIT_Z
static final Vector3d NEG_UNIT_Z
static Vector3d create(Vector3d vector)
vector
- the vector whose component values are set to the new vectorstatic Vector3d create(double x, double y, double z)
x
- the x component valuey
- the y component valuez
- the z component valuestatic MVector3d centroidOf(Collection<? extends Vector3d> vectors)
vectors
- the vectors for which the centroid is computeddouble angle(Vector3d vector)
vector
- the vector to which the angle is computeddouble distance(Vector3d vector)
vector
- the vector to which the distance is computeddouble distanceSquared(Vector3d vector)
vector
- the vector to which the squared distance is computeddouble dotProduct(Vector3d vector)
vector
- the vector with which the dot product is computedboolean equalsWithTolerance(Vector3d vector, double tolerance)
vector
- the vector with which this vector is compared for
approximate equalitytolerance
- the allowed deviation between this vector and the given
vectordouble getX()
double getY()
double getZ()
double getLengthSquared()
double getLength()
MVector3d crossProduct(Vector3d vector)
vector
- the vector with which the cross product is computedMVector3d subtract(Vector3d vector)
vector
- the vector on the right side of the differenceMVector3d scale(double scalar)
scalar
- the scalar by which the returned vector is scaledMVector3d add(Vector3d vector)
vector
- the vector that is added to this to create the returned
vectorMVector2d to2dVector()
MVector3d normalize()
MVector3d negate()
MVector3d interpolate(Vector3d vector, double alpha)
vector
- the vector with which this is interpolatedalpha
- the interpolation factorOptional<Vector3d> project(Vector3d vector)
vector
- the vector onto which this vector is to be projected orthogonallyCopyright © 2019 Solibri, Inc.. All rights reserved.