Skip to content

Commit

Permalink
Quick fix to use units::abs
Browse files Browse the repository at this point in the history
  • Loading branch information
sufferiing authored Dec 23, 2024
1 parent 9424cf5 commit c6c0979
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/units/Vector2D.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "units/units.hpp"
#include "units/Angle.hpp"

namespace units {
Expand Down Expand Up @@ -42,7 +43,7 @@ template <isQuantity T> class Vector2D {
* @param m magnitude
*/
static Vector2D fromPolar(Angle t, T m) {
m = m.abs();
m = abs(m);
t = constrainAngle360(t);
return Vector2D<T>(m * cos(t), m * sin(t));
}
Expand Down Expand Up @@ -324,4 +325,4 @@ typedef Vector2D<Length> V2Position;
typedef Vector2D<LinearVelocity> V2Velocity;
typedef Vector2D<LinearAcceleration> V2Acceleration;
typedef Vector2D<Force> V2Force;
} // namespace units
} // namespace units

0 comments on commit c6c0979

Please sign in to comment.