We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
units::abs
1 parent 9424cf5 commit c6c0979Copy full SHA for c6c0979
include/units/Vector2D.hpp
@@ -1,5 +1,6 @@
1
#pragma once
2
3
+#include "units/units.hpp"
4
#include "units/Angle.hpp"
5
6
namespace units {
@@ -42,7 +43,7 @@ template <isQuantity T> class Vector2D {
42
43
* @param m magnitude
44
*/
45
static Vector2D fromPolar(Angle t, T m) {
- m = m.abs();
46
+ m = abs(m);
47
t = constrainAngle360(t);
48
return Vector2D<T>(m * cos(t), m * sin(t));
49
}
@@ -324,4 +325,4 @@ typedef Vector2D<Length> V2Position;
324
325
typedef Vector2D<LinearVelocity> V2Velocity;
326
typedef Vector2D<LinearAcceleration> V2Acceleration;
327
typedef Vector2D<Force> V2Force;
-} // namespace units
328
+} // namespace units
0 commit comments