Skip to content

Commit

Permalink
Corect version of min.
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-rosso committed Jun 16, 2022
1 parent a9bf8ca commit 34561fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shapes/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ computeIdealControlPointDistance(const Vec2D& toPrev, const Vec2D& toNext, float
// Get the angle between next and prev
float angle = fabs(atan2(Vec2D::cross(toPrev, toNext), Vec2D::dot(toPrev, toNext)));

return min(radius,
(4.0f / 3.0f) * tan(math::PI / (2.0f * ((2.0f * math::PI) / angle))) * radius *
(angle < math::PI / 2 ? 1 + cos(angle) : 2.0f - sin(angle)));
return fmin(radius,
(4.0f / 3.0f) * tan(math::PI / (2.0f * ((2.0f * math::PI) / angle))) * radius *
(angle < math::PI / 2 ? 1 + cos(angle) : 2.0f - sin(angle)));
}

StatusCode Path::onAddedClean(CoreContext* context) {
Expand Down

0 comments on commit 34561fd

Please sign in to comment.