Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/packingsolver/irregular/shape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ struct Point

Point rotate(Angle angle) const;

Point rotate_radians(Angle angle) const;

Point axial_symmetry_identity_line() const;

Point axial_symmetry_y_axis() const;
Expand Down
9 changes: 9 additions & 0 deletions src/irregular/shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ Point Point::rotate(
}
}

Point Point::rotate_radians(
Angle angle) const
{
Point point_out;
point_out.x = std::cos(angle) * x - std::sin(angle) * y;
point_out.y = std::sin(angle) * x + std::cos(angle) * y;
return point_out;
}

Point Point::axial_symmetry_identity_line() const
{
Point point_out;
Expand Down
Loading