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

xyz2irc() is not inverse of irc2xyz() #96

Open
jiangjy1982 opened this issue Aug 9, 2022 · 0 comments
Open

xyz2irc() is not inverse of irc2xyz() #96

jiangjy1982 opened this issue Aug 9, 2022 · 0 comments

Comments

@jiangjy1982
Copy link

In this line, the inverse rotation needs to be left-multiplied rather than right-multiplied.

The correctness can be verified by the following code snippet:

import numpy as np
from util.util import irc2xyz, xyz2irc

origin_xyz = np.array([-100, -200, -300])
vxSize_xyz = np.array([1, 1, 2])
theta = np.radians(30)
c, s = np.cos(theta), np.sin(theta)
direction_a = np.array(((c, -s, 0), (s, c, 0), (0, 0, 1)))
xyz2irc([*irc2xyz([1, 2, 3], origin_xyz, vxSize_xyz, direction_a)], origin_xyz, vxSize_xyz, direction_a)
# Expect to return [1, 2, 3]
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

1 participant