Class representing a 2d vector. Depending on unit this could be a Translation2d, Velocity2d, Acceleration2d, Jerk2d, or other
Assumes conventional cartesian coordinate system: Looking down at the coordinate plane, +X is right +Y is up +Theta is counterclockwise
|
|
constexpr | LinearVector2d () |
| | Default Constructor for LinearVector2d valued (0, 0).
|
| constexpr | LinearVector2d (Q x, Q y) |
| constexpr | LinearVector2d (Q r, Rotation2d theta) |
| constexpr | LinearVector2d (Eigen::Vector2d vector, Q unit) |
|
constexpr Q | x () const |
| | Gets the x component.
|
|
constexpr double | x (Q unit) const |
| | Gets x in the supplied unit.
|
|
constexpr void | set_x (Q val) |
| | Sets the x component.
|
|
constexpr Q | y () const |
| | Gets the y component.
|
|
constexpr double | y (Q unit) const |
| | Gets y in the supplied unit.
|
|
constexpr void | set_y (Q val) |
| | Sets the y component.
|
|
constexpr Rotation2d | theta () const |
| | Gets the angle of the vector from the x axis.
|
| constexpr Eigen::Vector2d | as_vector (Q unit) const |
|
constexpr Q | norm () const |
| | Gets the norm of the vector.
|
| constexpr LinearVector2d | normalize (Q magnitude=Q(1.0)) const |
|
constexpr Q | distance (LinearVector2d other) const |
| | Gets the distance between two vectors.
|
| constexpr LinearVector2d | interpolate (LinearVector2d end, double fraction) const |
| constexpr LinearVector2d | rotate_by (Rotation2d rotation) const |
| constexpr LinearVector2d | rotate_around (LinearVector2d other, Rotation2d rotation) const |
| constexpr LinearVector2d | inverse () const |
| constexpr units::Multiplied< Q, Q > | dot (LinearVector2d other) const |
|
constexpr LinearVector2d | operator+ (LinearVector2d other) const |
| | Adds another vector to this vector component wise.
|
|
constexpr LinearVector2d & | operator+= (LinearVector2d other) |
| | Adds another vector to this vector component wise.
|
|
constexpr LinearVector2d | operator- (LinearVector2d other) const |
| | Subtracts another vector from this vector component wise.
|
|
constexpr LinearVector2d & | operator-= (LinearVector2d other) |
| | Subtracts another vector from this vector component wise.
|
|
constexpr LinearVector2d | operator- () const |
| | Inverts this vector (flipped across origin).
|
|
constexpr LinearVector2d | operator* (double scalar) const |
| | Multiplies this vector by a scalar.
|
template<units::IsQuantity S>
requires LinearKinematicQuantity<units::Multiplied<Q, S>> |
| constexpr LinearVector2d< units::Multiplied< Q, S > > | operator* (S scalar) const |
| constexpr units::Multiplied< Q, Q > | operator* (LinearVector2d other) const |
|
constexpr LinearVector2d & | operator*= (double scalar) |
| | Multiplies this vector by a scalar.
|
|
constexpr LinearVector2d | operator/ (double scalar) const |
| | Divides this vector by a scalar.
|
template<units::IsQuantity S>
requires LinearKinematicQuantity<units::Divided<Q, S>> |
| constexpr LinearVector2d< units::Divided< Q, S > > | operator/ (S scalar) const |
|
constexpr LinearVector2d & | operator/= (double scalar) |
| | Divides this vector by a scalar.
|
|
constexpr bool | operator== (LinearVector2d other) const |
| | Checks exact equality between this and another vector.
|
| constexpr bool | is_near (LinearVector2d other, Q tolerance=Q(1e-6)) const |