Skip to content

Commit

Permalink
fix: standardize the width
Browse files Browse the repository at this point in the history
Signed-off-by: Shumpei Wakabayashi <[email protected]>
  • Loading branch information
shmpwk committed May 5, 2024
1 parent 502a7fd commit 4a2f0ba
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ void visualizeBound(
if (diff_angle == 0.0) {
return std::make_pair(normal_vector_angle, width);
}

return std::make_pair(normal_vector_angle, width / std::sin(diff_angle));
const float adjusted_width = width / std::sin(diff_angle);
if (std::abs(adjusted_width) > 1.0) {
return std::make_pair(normal_vector_angle, adjusted_width / std::abs(adjusted_width));
} else {
return std::make_pair(normal_vector_angle, adjusted_width);
}
}();

normal_vector_angles.push_back(normal_vector_angle);
Expand Down

0 comments on commit 4a2f0ba

Please sign in to comment.