# LVector3d¶

class LVector3d

Bases: LVecBase3d

This is a three-component vector distance (as opposed to a three-component point, which represents a particular point in space). Some of the methods are slightly different between LPoint3 and LVector3; in particular, subtraction of two points yields a vector, while addition of a vector and a point yields a point.

Inheritance diagram

LVector3d(void) = default
LVector3d(LVecBase3d const &copy)
LVector3d(double fill_value)
LVector3d(double x, double y, double z)
LVector3d(LVecBase2d const &copy, double z)
LVector3d(LVector3d const&) = default
double angle_deg(LVector3d const &other) const

Returns the angle between this vector and the other one, expressed in degrees. Both vectors should be initially normalized.

double angle_rad(LVector3d const &other) const

Returns the unsigned angle between this vector and the other one, expressed in radians. Both vectors should be initially normalized.

LVector3d back(CoordinateSystem cs = ::CS_default)

Returns the back vector for the given coordinate system.

LVector3d cross(LVecBase3d const &other) const
LVector3d down(CoordinateSystem cs = ::CS_default)

Returns the down vector for the given coordinate system.

LVector3d forward(CoordinateSystem cs = ::CS_default)

Returns the forward vector for the given coordinate system.

static TypeHandle get_class_type(void)
LVector2d get_xy(void) const

Returns a 2-component vector that shares just the first two components of this vector.

LVector2d get_xz(void) const

Returns a 2-component vector that shares just the first and last components of this vector.

LVector2d get_yz(void) const

Returns a 2-component vector that shares just the last two components of this vector.

LVector3d left(CoordinateSystem cs = ::CS_default)

Returns the left vector for the given coordinate system.

LVector3d normalized(void) const

Normalizes the vector and returns the normalized vector as a copy. If the vector was a zero-length vector, a zero length vector will be returned.

LVector3d project(LVecBase3d const &onto) const

Returns a new vector representing the projection of this vector onto another one. The resulting vector will be a scalar multiple of onto.

double relative_angle_deg(LVector3d const &other) const

Deprecated: Do not use.

double relative_angle_rad(LVector3d const &other) const

Deprecated: Do not use.

LVector3d rfu(double right, double fwd, double up, CoordinateSystem cs = ::CS_default)

INLINE_LINMATH static FLOATNAME(LVector3) & rfu(FLOATTYPE right,

Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.

LVector3d right(CoordinateSystem cs = ::CS_default)

Returns the right vector for the given coordinate system.

double signed_angle_deg(LVector3d const &other, LVector3d const &ref) const

Returns the signed angle between two vectors. The angle is positive if the rotation from this vector to other is clockwise when looking in the direction of the ref vector.

Vectors (except the ref vector) should be initially normalized.

double signed_angle_rad(LVector3d const &other, LVector3d const &ref) const

returns the signed angle between two vectors. The angle is positive if the rotation from this vector to other is clockwise when looking in the direction of the ref vector.

Vectors (except the ref vector) should be initially normalized.

LVector3d const &unit_x(void)

Returns a unit X vector.

LVector3d const &unit_y(void)

Returns a unit Y vector.

LVector3d const &unit_z(void)

Returns a unit Z vector.

LVector3d up(CoordinateSystem cs = ::CS_default)

Returns the up vector for the given coordinate system.

LVector3d const &zero(void)

Returns a zero-length vector.