Pivoting image around a fixed point

How to transform x and y got from the accelerometer to rotate an image around it’s center to simulate, for example, the movement of a pivoting weight around a fixed point?
Perhaps x,y from accelerometer is not a good idea?
Thanks to point me the right way. [import]uid: 8970 topic_id: 3252 reply_id: 303252[/import]

You take the x & y components, make an imaginary point, calc the angle of the point from the centre of the iPhone screen and use that angle to control the rotation of the image.

pythagoras theorem will sort the calculations

see my joystick example in the sample code part of the website to see those calculations in action [import]uid: 5354 topic_id: 3252 reply_id: 9659[/import]

I just did something like this for my splash screen if you don’t have an answer by the time I get home from work I’ll post my code for you [import]uid: 7911 topic_id: 3252 reply_id: 9694[/import]

A great thank for your help and attention! It rotates! You’re like GPS!

I would like to try now to give more realism by adding oscillating movements before the weight stabilizes. I think I need to catch instantaneous acceleration (event.xInstant and event.yInstant) and to mix with the actual code… Ideas welcome if not to much to ask.
[import]uid: 8970 topic_id: 3252 reply_id: 9850[/import]