开发者

iPhone, how to calculate iPhone device three axis angle via UIAcceleration?

as topic,

I am try to use the code as follows :

xAngle = 90.0 *x; yAngle = 90.0开发者_如何学Go* y; zAngle = 90.0* z;

but seem it is not right (x,y,z is the UIAcceleration attributes x, y and z)

am I miss some thing in this algorithm ?

thanks for your help

Best .


cos (angleXaxis) = x / sqrt(x^2 + y^2 + z^2)

cos (angleYaxis) = y / sqrt(x^2 + y^2 + z^2)

cos (angleZaxis) = z / sqrt(x^2 + y^2 + z^2)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜