What I am missing is

motionManager.deviceMotion.quaternion

Can you implement this in the runtime?

Or can I extend the runtime by myself?

I need quaternion orientation for my electronic flight instrument project.

Currently Codea only provides gravity x, y, z

With these I can calculate pitch and roll by

grx= Gravity.x

gry = Gravity.y

pitch = math.atan(gry,math.sqrt(grx*grx+grz*grz))

roll = math.atan(-grx,grz)

But this math is not nice. It gives wrong attitudes i.e. when flying a looping, since the pitch range is [-90;90] and the roll range is [-180;180], some numbers belong to 2 attitudes.

Quaternions would solve that. And IOS provides quaternion attitude in CMMotionManager

Regard

Odo