11-28-2022, 08:36 PM
MOD is one of my favorite little lesser known tools. I first discovered its utility when trying to do a degree wheel graphic.
Code: (Select All)
SCREEN _NEWIMAGE(640, 640, 32)
WINDOW (-1000, 1000)-(1000, -1000)
CLS
_CLEARCOLOR _RGB32(0, 0, 0)
FOR whl% = 0 TO 359 ' iterate through azimuth wheel
IF whl% MOD 45 = 0 THEN ' 45 degree tick and number
y = 900
ELSEIF whl% MOD 10 = 0 THEN ' 10 degree tick
y = 950
ELSEIF whl% MOD 5 = 0 THEN ' 5 degree tick
y = 970
ELSE ' 1 degree tick
y = 990
END IF
'Draw azimuth tick
LINE (1000 * SIN(_D2R(whl%)), 1000 * COS(_D2R(whl%)))-(y * SIN(_D2R(whl%)), y * COS(_D2R(whl%))), &HAFA800A8
NEXT whl%
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na: