Here's my issue:
In the image, I know that my distance from the centre of the screen is 100 units.
From the device accelerometer I know that x = "0.4" and y = "0.5"
I need to convert the x and y ratios to units so that I can place my graphic 100 units from the centre, in the direction I am tipping the device.
This is my code which works, but I'm sure it could be so much neater. H# is the hypotenuse of the triangle, x# and y# are my final values in units. My theory is that I have to convert 100 units to the same scale as the x/y ratios, so that I can then multiply the ratios out to units.
dist# = 100
` Get Angle
angle# = gAccel.current.y / (tan(gAccel.current.X))
` Convert 100 (units) to ratio like x and y
H# = abs(gAccel.current.Y / (sin(angle#)))
` Convert x and y to units
x# = dist# / H# * gAccel.current.X
y# = dist# / H# * gAccel.current.Y