Interface MVector3d
-
-
Field Summary
-
Fields inherited from interface com.solibri.geometry.linearalgebra.Vector3d
NEG_UNIT_X, NEG_UNIT_Y, NEG_UNIT_Z, UNIT_X, UNIT_Y, UNIT_Z, ZERO
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addInPlace(Vector3d vector)
Adds the given vector to this vector in place.static MVector3d
create()
Returns a new instance with all components set to zero.static MVector3d
create(double xyz)
Returns a new instance with all components set to the given value.static MVector3d
create(double x, double y, double z)
Returns a new instance with the given component values.static MVector3d
create(Vector3d vector)
Returns a new instance with the same component values as in the given vector.void
crossProductInPlace(Vector3d vector)
Sets this vector to the cross product of this vector and the other vector.void
interpolateInPlace(Vector3d vector, double alpha)
Interpolates linearly between this vector and the given vector and places the result in this vector (this = (1 - alpha) * this + alpha * vector).void
negateInPlace()
Negates this vector in place.void
normalizeInPlace()
Normalizes this vector in place.void
scaleInPlace(double scalar)
Scales this vector in place by the given scalar.void
set(double x, double y, double z)
Sets the value of this vector to the given values.void
set(Vector3d vector)
Sets the value of this vector to the value of the given vector.void
setX(double x)
Sets the X component of this vector.void
setY(double y)
Sets the Y component of this vector.void
setZ(double z)
Sets the Z component of this vector.void
subtractInPlace(Vector3d vector)
Subtracts the given vector from this vector.static List<MVector3d>
to3dVectors(List<? extends Vector2d> vectors)
Returns a list of 3-dimensional vectors with the X and Y components from the given vectors and the Z component set to 0.-
Methods inherited from interface com.solibri.geometry.linearalgebra.Vector3d
add, angle, crossProduct, distance, distanceSquared, dotProduct, equalsWithTolerance, getLength, getLengthSquared, getX, getY, getZ, interpolate, negate, normalize, project, scale, subtract, to2dVector
-
-
-
-
Method Detail
-
create
static MVector3d create()
Returns a new instance with all components set to zero.- Returns:
- a new zero vector
- Since:
- 9.10.2
-
create
static MVector3d create(double xyz)
Returns a new instance with all components set to the given value.- Parameters:
xyz
- the value set to all components of the returned vector- Returns:
- a new instance with all components set to the given value
- Since:
- 9.10.2
-
create
static MVector3d create(Vector3d vector)
Returns a new instance with the same component values as in the given vector.- Parameters:
vector
- the vector used for setting the values of the returned vector- Returns:
- a new instance with the same component values as in the given vector
- Since:
- 9.10.2
-
create
static MVector3d create(double x, double y, double z)
Returns a new instance with the given component values.- Parameters:
x
- the X component valuey
- the Y component valuez
- the Z component value- Returns:
- a vector with the given component values
- Since:
- 9.10.2
-
to3dVectors
static List<MVector3d> to3dVectors(List<? extends Vector2d> vectors)
Returns a list of 3-dimensional vectors with the X and Y components from the given vectors and the Z component set to 0. The order of the vectors is preserved.- Parameters:
vectors
- vectors in the XY-plane that are used for setting the X and Y components of the returned vectors- Returns:
- a list of 3-dimensional vectors with the X and Y components from the given vectors and the Z component set to 0
- Since:
- 9.10.2
-
addInPlace
void addInPlace(Vector3d vector)
Adds the given vector to this vector in place.- Parameters:
vector
- vector that is added to this- Since:
- 9.10.2
-
crossProductInPlace
void crossProductInPlace(Vector3d vector)
Sets this vector to the cross product of this vector and the other vector.- Parameters:
vector
- the vector with which the cross product is computed- Since:
- 9.10.2
-
negateInPlace
void negateInPlace()
Negates this vector in place.- Since:
- 9.10.2
-
normalizeInPlace
void normalizeInPlace()
Normalizes this vector in place. If the length of the vector is 0, then the components of the vector will become NaN.- Since:
- 9.10.2
-
interpolateInPlace
void interpolateInPlace(Vector3d vector, double alpha)
Interpolates linearly between this vector and the given vector and places the result in this vector (this = (1 - alpha) * this + alpha * vector). If the alpha value is greater than 1 it is set to 1 and if the alpha value is smaller than 0 it is set to 0.- Parameters:
vector
- vector used for interpolationalpha
- interpolation coefficient- Since:
- 9.10.2
-
scaleInPlace
void scaleInPlace(double scalar)
Scales this vector in place by the given scalar.- Parameters:
scalar
- the scalar by which this is scaled- Since:
- 9.10.2
-
set
void set(double x, double y, double z)
Sets the value of this vector to the given values.- Parameters:
x
- the value for X componenty
- the value for Y componentz
- the value for Z component- Since:
- 9.10.2
-
set
void set(Vector3d vector)
Sets the value of this vector to the value of the given vector.- Parameters:
vector
- the vector that specifies the value that is set to this vector- Since:
- 9.10.2
-
setX
void setX(double x)
Sets the X component of this vector.- Parameters:
x
- the value for the X component- Since:
- 9.10.2
-
setY
void setY(double y)
Sets the Y component of this vector.- Parameters:
y
- the value for the Y component.- Since:
- 9.10.2
-
setZ
void setZ(double z)
Sets the Z component of this vector.- Parameters:
z
- the value for the Z component- Since:
- 9.10.2
-
subtractInPlace
void subtractInPlace(Vector3d vector)
Subtracts the given vector from this vector.- Parameters:
vector
- vector that is subtracted from this- Since:
- 9.10.2
-
-