home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
DEG2RAD.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
53 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-11-15 ╟─╖
│ │ FILE NAME DEG2RAD .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
This little function is for those of you who, like me, either failed
Geometry or/and were sailors and/or are more use to dealing with circles
in degrees instead of radians. For me a circle STARTS at the top (North)
and things proceed in a clockwise mannor where East is 90°, South is 180°,
and West is at 270°. Both of these use pPi# so you will need PUBLICS.INC
or at least the PUBLIC variable pPi# laying around somewhere.
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "PUBLICS.INC" ' uses pPi# too
$INCLUDE "DAS-NBV1.INC" '
'
CLS '
SCREEN 12 '
LOCATE 7, 41 : PRINT "0°" '
LOCATE 15, 55 : PRINT "90°" '
LOCATE 24, 39 : PRINT "180°" '
LOCATE 15, 24 : PRINT "270°" '
'
X% = 319 '
Y% = 240 '
LINE (X%,0)-(X%,479), 8 ' X,Y lines
LINE (0,Y%)-(639,Y%), 8 '
StartR# = fDeg2Rad#( 0 ) ' gotta start somewhere
FOR R% = 10 TO 360 STEP 10 ' every 10 degrees
EndR# = fDeg2Rad#( R% ) ' note that start/end are
CIRCLE (X%,Y%), 100, 15, -EndR#, -StartR#, 1 ' reversed when using CIRCLE
StartR# = EndR# ' with Degrees
IF INSTAT THEN EXIT FOR '
NEXT ' Ya' gotta' play with this
' puppy for a while but it
WHILE NOT INSTAT : WEND ' works just fine!
CLS '
SCREEN 0 '