In the realm of planar 2D geometry, the formula for rotating a point (x,y) about the origin point (0,0) in the counter-clockwise direction is taken to be this:
new x = x * cos(angle) - y * sin(angle) new y = x * sin(angle) + y * cos(angle)This can be adapted to SB pretty much directly, assuming all numbers are real-type. To rotate around a point that isn't the origin, simply subtract the center point's coordinates from the coordinates to rotate. SIN and COS take angles in radians. Some SB pseudo-code:
'assuming CX# and CY# are the coordinates of the center 'assuming X# and Y# are the coordinates of the point to be rotated 'assuming R# is the angle of rotation, in radians 'assuming NX# and NY# are the coordinates of the new point (the result) C#=COS(R#) S#=SIN(R#) DX#=X#-CX# DY#=Y#-CY# NX#=DX#*C#-DY#*S NY#=DX#*S#+DY#*C