NEG_UNIT_X, NEG_UNIT_Y, UNIT_X, UNIT_Y, ZERO
Modifier and Type | Method and Description |
---|---|
void |
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 |
create(Vector2d vec)
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 |
negateInPlace()
Negates this vector in place.
|
void |
normalizeInPlace()
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 |
set(Vector2d vec)
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.
|
static List<MVector2d> |
to2dVectors(List<? extends Vector3d> vectors)
Returns the vectors in the given list projected to the XY-plane.
|
add, angle, distance, distanceSquared, dotProduct, equalsWithTolerance, getClockwiseAngle, getLength, getLengthSquared, getX, getY, interpolate, negate, normalize, scale, subtract, to3dVector
static MVector2d create()
static MVector2d create(double x, double y)
static MVector2d create(Vector2d vec)
static List<MVector2d> to2dVectors(List<? extends Vector3d> vectors)
to2dVectors
in interface Vector2d
vectors
- vectors that are projected to the XY-planevoid addInPlace(Vector2d vec)
vec
- vector that is added to this vectorvoid interpolateInPlace(Vector2d vector, double alpha)
vector
- the vector with which this is interpolatedalpha
- the interpolation factorvoid negateInPlace()
void normalizeInPlace()
void scaleInPlace(double scalar)
scalar
- the scalar used in the multiplicationvoid set(double x, double y)
x
- the value of the X componenty
- the value of the Y componentvoid set(Vector2d vec)
vec
- the vector used for setting the values of this vectorvoid setX(double x)
x
- the value for the X componentvoid setY(double y)
y
- the value for the Y componentvoid subtractInPlace(Vector2d other)
other
- the vector that is subtracted from this vectorCopyright © 2019 Solibri, Inc.. All rights reserved.