Re: The different results given by scipy and https://quaternions.online/ when converting Euler angles to Quaternion representation.
Hongyi Zhao <[email protected]> Wed, 28 Oct 2020 16:55:18 +0800
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <CAGP6PO+6KQ=C4wkd7jzBXoCby-HS+Wj7u5ZgGarxR=D9an1QBQ@mail.gmail.com> |
On Wed, Oct 28, 2020 at 4:29 PM Guillaume Gay <[email protected]> wrote: > > Hi, Hongyi, > > > This seems to have to do first with extrinsic vs intrinsic order, (the > website seems to assume intrinsic angles). Where are the origins of the coordinates and the positions of the three coordinate axes for extrinsic and intrinsic order, respectively? > Thus with "XYZ" as first > argument, the result are still different but that difference is > consistent (which is not the case for e.g. `r = R.from_euler('xyz', [30, > 45, 30], degrees=True)` which gives different values all together on > your website / with scipy. > > > r = R.from_euler('XYZ', [90, 45, 30], degrees=True) > > r.as_quat() > > array([0.70105738, 0.09229596, 0.43045933, 0.56098553]) > > the result is now a permutation away from what the website says. > > > I'd test with 'obvious' cases to get to the bottom of that, but I mostly > think one should trust scipy to do "the right thing" as it has had more > scrutiny than the website. Thanks a lot for your suggestions and experiences. Regards, HY > > > Hope this helps > > > Le 27/10/2020 à 14:19, Hongyi Zhao a écrit : > > Hi, > > > > I try to convert between Euler angle and Quaternion representations. > > But I obtained different results when using scipy and the online > > converter (https://quaternions.online/). See following for detailed > > info: > > > > The results obtained from scipy: > > > > In [14]: from scipy.spatial.transform import Rotation as R > > > > In [15]: r = R.from_euler('xyz', [90, 45, 30], degrees=True) > > In [17]: r.as_quat() > > Out[17]: array([ 0.56098553, 0.43045933, -0.09229596, 0.70105738]) > > > > The results given by the online converter (https://quaternions.online/): > > > > w: 0.561 > > x: 0.701 > > y: 0.092 > > z: 0.430 > > > > Any hints for this problem will be highly appreciated? > > > > Regards, > > HY > _______________________________________________ > SciPy-User mailing list > [email protected] > https://mail.python.org/mailman/listinfo/scipy-user -- Assoc. Prof. Hongyi Zhao <[email protected]> Theory and Simulation of Materials, Xingtai Polytechnic College NO. 552 North Gangtie Road, Xingtai, China _______________________________________________ SciPy-User mailing list [email protected] https://mail.python.org/mailman/listinfo/scipy-user