Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation of Polyhedra #245

Open
anicusan opened this issue Mar 10, 2021 · 1 comment
Open

Rotation of Polyhedra #245

anicusan opened this issue Mar 10, 2021 · 1 comment

Comments

@anicusan
Copy link

The translate function is extremely useful for a moving object; would it also be possible to implement a rotate(p::Polyhedron, r) function, receiving a N x N rotation matrix r, where N is the dimensionality of the Polyhedron? For example, the V-representation would be quite easy to modify - just compute the dot product of the rotation matrix and each vertex.

I am willing to contribute this function myself if a more experienced Polyhedra.jl developer could give me some directions. Specfically, my mathematical background is rather different from geometric sets, so I am not entirely sure how to change the H-representation.

@blegat
Copy link
Member

blegat commented May 27, 2021

If r is a matrix, you can just do r * p. This will use the V-representation. I don't know of any way to get the linear image of a H-representation if the matrix is not invertible.
If the matrix is invertible, you can do inv(r) \ p which uses the H-representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants