DAY 020: MOD
#8
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:
Reply


Messages In This Thread
DAY 020: MOD - by SMcNeill - 11-28-2022, 02:00 AM
RE: DAY 020: MOD - by mnrvovrfc - 11-28-2022, 02:28 AM
RE: DAY 020: MOD - by TerryRitchie - 11-28-2022, 02:32 AM
RE: DAY 020: MOD - by bplus - 11-28-2022, 02:46 AM
RE: DAY 020: MOD - by Pete - 11-28-2022, 03:31 AM
RE: DAY 020: MOD - by Pete - 11-28-2022, 04:11 AM
RE: DAY 020: MOD - by vince - 11-28-2022, 01:45 PM
RE: DAY 020: MOD - by OldMoses - 11-28-2022, 08:36 PM



Users browsing this thread: 4 Guest(s)