Code: (Select All)
Sub orbit (x0rigin, yOrigin, radius, degrees, xOut, yOut) ' all default single should be ok
xOut = x0rigin + radius * Cos(_D2R(degrees))
yOut = yOrigin + radius * Sin(_D2R(degrees))
End Sub
x0rigin, yOrigin.......radius
o--------------------->
.\oooooooooooooo
..\ooooooooooooo
...\ooooooooooo degrees
....\oooooooo
.....\ooooo
......vo
.......(xOut, yOut)
orbit is a Sub not a Function so it returns it's results: xOut and yOut as changed inputs to the sub so the calling code can use xOut, yOut for the point that is radius away from xOrigin, yOrigin at degrees clockwise from 0 degrees that is due east.
b = b + ...