and if that don't help try this:
1.get a paper and pen
2.draw a circle
3.draw a veritcle line going straight through the centre(this will be z axis)
4.draw a horizontal line going through centre (x axis)
(we are looking down from above)
5.draw a line from the centre to the circles perimeter at an angle of roughly 45o (this line is the hypotenuse)
6.draw a line from the point where the hypotenuse is touching the circles perimeter down to the x axis (this line is the height).
7.now draw a line from bottom of height to centre of circle( this line is base)
now you should have a circle with a tringle in it
ok the hypotonuse will represent the radius (this will stay the same)
now imagine the hypotonuse rotates (clockwise or ant-clockwise) its length stays same, but the length of the triangles height(z axis) and base (x axis) will change.
so every time the hypotonuse rotates (angle increases or decreases) we have to calculate a new height and base (z and x)
to workout new height (z axis) do this:
sin(angle)*radius
and the base (x axis) do this:
cos(angle)*radius
ok using these principles i done a little thing to make a sphere rotate around a cube:
color backdrop 0
hide mouse
sync on
sync rate 30
make object cube 1,.6
make object sphere 2,.3
`u can start angle# at any value 0-360
angle#=180
`radius from centre of ball to centre of cube (the hypotenuse)
radius#=.8
do
position object 2,sin(wrapvalue(angle#))*radius#,0,cos(wrapvalue(angle#))*radius#
xrotate object 1,object angle x(1)+1
yrotate object 1,object angle y(1)+1
dec angle#,2
set cursor 100,0
print "Sphere X: ";object position x(2)
set cursor 100,15
print "Sphere Z: ";object position z(2)
sync
loop
these basics can be used for many aspects in game programing:especialy 3d. try changing my program so u can move cube and keep the sphere rotating or add a smaller object rotaing around the sphere which rotates around the cube.
camera positions often require these kind of calculations.
load the text program in the dbp help\examples folder for a 2d use of cos & sin
neway hope that helps
have fun