Interface MVector2d
- All Superinterfaces:
Vector2d
Interface for handling vectors in the XY-plane. Allows modification of the
vector.
- Since:
- 9.10.2
-
Field Summary
Fields inherited from interface com.solibri.geometry.linearalgebra.Vector2d
NEG_UNIT_X, NEG_UNIT_Y, UNIT_X, UNIT_Y, ZERO
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addInPlace(Vector2d vec)
Adds the given vector to this vector in place.static MVector2d
create()
Returns a 2-dimensional vector with the X and Y values set to 0.static MVector2d
create(double x, double y)
Returns a 2-dimensional vector with the given component values.static MVector2d
Returns a 2-dimensional vector with the X and Y values set to those of the given vector.void
interpolateInPlace(Vector2d vector, double alpha)
Sets this vector to be the interpolation between this vector and the given vector so that the weight of the given vector is alpha (this = (1 - alpha) * this + alpha * vector).void
Negates this vector in place.void
Normalizes this vector in place to be of length 1.void
scaleInPlace(double scalar)
Multiplies this vector in place by the given scalar.void
set(double x, double y)
Sets the X and Y components of this vector to the given values.void
Sets the X and Y components of this vector to the values 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
subtractInPlace(Vector2d other)
Subtracts in place the given vector from this vector.to2dVectors(List<? extends Vector3d> vectors)
Returns the vectors in the given list projected to the XY-plane.Methods inherited from interface com.solibri.geometry.linearalgebra.Vector2d
add, angle, distance, distanceSquared, dotProduct, equalsWithTolerance, getClockwiseAngle, getLength, getLengthSquared, getX, getY, interpolate, negate, normalize, scale, subtract, to3dVector
-
Method Details
-
create
Returns a 2-dimensional vector with the X and Y values set to 0.- Returns:
- a vector with all components set to 0.
- Since:
- 9.10.2
-
create
Returns a 2-dimensional vector with the given component values.- Parameters:
x
- the value of the X componenty
- the value of the Y component- Returns:
- a 2-dimensional vector with the given component values
- Since:
- 9.10.2
-
create
Returns a 2-dimensional vector with the X and Y values set to those of the given vector.- Parameters:
vec
- the vector used for setting the values of the created vector- Returns:
- a 2-dimensional vector with the values set to those of the given vector
- Since:
- 9.10.2
-
to2dVectors
Returns the vectors in the given list projected to the XY-plane. The order of the vectors is preserved.- Parameters:
vectors
- vectors that are projected to the XY-plane- Returns:
- the vectors in the given list projected to the XY-plane
- Since:
- 9.10.2
-
addInPlace
Adds the given vector to this vector in place.- Parameters:
vec
- vector that is added to this vector- Since:
- 9.10.2
-
interpolateInPlace
Sets this vector to be the interpolation between this vector and the given vector so that the weight of the given vector is alpha (this = (1 - alpha) * this + alpha * vector). Values smaller than 0 default to 0 and value greater than 1 default to 1.- Parameters:
vector
- the vector with which this is interpolatedalpha
- the interpolation factor- Since:
- 9.10.2
-
negateInPlace
void negateInPlace()Negates this vector in place.- Since:
- 9.10.2
-
normalizeInPlace
void normalizeInPlace()Normalizes this vector in place to be of length 1. If this vector is a zero vector, then all components of this vector are set to NaN.- Since:
- 9.10.2
-
scaleInPlace
void scaleInPlace(double scalar)Multiplies this vector in place by the given scalar.- Parameters:
scalar
- the scalar used in the multiplication- Since:
- 9.10.2
-
set
void set(double x, double y)Sets the X and Y components of this vector to the given values.- Parameters:
x
- the value of the X componenty
- the value of the Y component- Since:
- 9.10.2
-
set
Sets the X and Y components of this vector to the values of the given vector.- Parameters:
vec
- the vector used for setting the values of 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
-
subtractInPlace
Subtracts in place the given vector from this vector.- Parameters:
other
- the vector that is subtracted from this vector- Since:
- 9.10.2
-