Use Base::toRadians() instead of manually converting
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include <Base/PlacementPy.h>
|
||||
#include <Base/QuantityPy.h>
|
||||
#include <Base/RotationPy.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "ExpressionParser.h"
|
||||
@@ -2213,7 +2214,7 @@ Py::Object FunctionExpression::evaluate(const Expression *expr, int f, const std
|
||||
|
||||
Rotation rotation = Base::Rotation(
|
||||
Vector3d(static_cast<double>(f == MROTATEX), static_cast<double>(f == MROTATEY), static_cast<double>(f == MROTATEZ)),
|
||||
rotationAngle.getValue() * pi / 180.0);
|
||||
Base::toRadians(rotationAngle.getValue()));
|
||||
Base::Matrix4D rotationMatrix;
|
||||
rotation.getValue(rotationMatrix);
|
||||
|
||||
@@ -2411,7 +2412,7 @@ Py::Object FunctionExpression::evaluate(const Expression *expr, int f, const std
|
||||
_EXPR_THROW("Unit must be either empty or an angle.", expr);
|
||||
|
||||
// Convert value to radians
|
||||
value *= pi / 180.0;
|
||||
value = Base::toRadians(value);
|
||||
unit = Unit();
|
||||
break;
|
||||
case ACOS:
|
||||
|
||||
Reference in New Issue
Block a user