moble / quaternionic

Interpret numpy arrays as quaternionic arrays with numba acceleration
MIT License
84 stars 7 forks source link

Unexpected result when give int spherical coordinates #29

Closed Editst closed 2 years ago

Editst commented 2 years ago

Hi, I'm not sure if this is a bug, but it's very confusing.

When I enter int theta and phi, it gives zeros.

import quaternionic
quaternionic.array.from_spherical_coordinates(1, 2)
# --> quaternionic.array([0., 0., 0., 0.])

Only when I explicitly enter float theta and phi, it gives the correct result.

import quaternionic
quaternionic.array.from_spherical_coordinates(1., 2.)
# --> quaternionic.array([ 0.47415988, -0.40342268,  0.25903472,  0.73846026])
moble commented 2 years ago

This is a bug. Thanks for reporting it.