hannorein / rebound

💫 An open-source multi-purpose N-body code.
https://rebound.readthedocs.io/
GNU General Public License v3.0
824 stars 218 forks source link

added edge case test to to_new_axes and added failing unit test #639

Closed dtamayo closed 1 year ago

dtamayo commented 1 year ago

Not really a patch...I added a failing unit test for an edge case in from_to that I think will come up a lot (when trying to rotate to the invariable plane when you're already aligned with it, so the line of nodes is undefined).

rebound.Rotation.from_to([1,0,0], [-1,0,0])

yields

<rebound.simulation.Rotation object at 0x1057a9240, ix=nan, iy=nan, iz=nan, r=nan>

I also added testing for that edge case in Rotation.to_new_axes in python

hannorein commented 1 year ago

Should be fixed now: 33a43c9df26890dcea23408927d67927c75acbd0