You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I have: myq = np.quaternion(ww,xx,yy,zz)
I can do
myq_x=myq.x # a float
myq_y=myq.y # a float
but not myq.x = myq.y # AttributeError: readonly attribute
I would find it useful to be able to have the quaternion attributes as write also, for example to easily change the axis of rotation. What is the reason to set them as readonly? And then how to, for example, swap 2 elements of a quaternion (such as swap xx with yy as above)?
The text was updated successfully, but these errors were encountered:
That's a great question! The "reason" they were set as READONLY is because I'm no expert on python's C API, so I just didn't know any better. I've changed that now, though, so if you update you should be able to set those components. Thanks!
The usual python way to swap a and b is to do a, b = b, a. So in this case, you can do
Say I have:
myq = np.quaternion(ww,xx,yy,zz)
I can do
but not
myq.x = myq.y # AttributeError: readonly attribute
I would find it useful to be able to have the quaternion attributes as write also, for example to easily change the axis of rotation. What is the reason to set them as readonly? And then how to, for example, swap 2 elements of a quaternion (such as swap xx with yy as above)?
The text was updated successfully, but these errors were encountered: