home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
COMP_ARC.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
59 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME COMP_ARC.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 one was left laying around from some drawing program we built years
ago. I've not used it in those many years but it still works and may just
come in handy sometime. You send it 3 points and it will return all the
data you need to draw an arc connecting the 3 points. All the data is
fed into a PolygonTYPE and you can use CIRCLE to get the arc drawn.
The array that you use to send the points' data into the function with
HAS to be DIMed XY%(1,2) or greater. It just took too much code and time
to make the function work on far pointers.
Try exchanging point 0 and point 2 data and watch what happens. It is
important to keep your points straight!
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB03.INC" ' needs the math package
$INCLUDE "DAS-NBV1.INC" '
$INCLUDE "PUBLICS.INC" ' uses pPi# too
'
CLS '
SCREEN 12 ' works better than text mode :)
GraphicSETUP '
'
DIM XY%(1,2), tP AS PolygonTYPE ' dim our goodies
'
XY%(0,0) = 100 : XY%(1,0) = 100 ' set the 3 points
XY%(0,1) = 200 : XY%(1,1) = 50 '
XY%(0,2) = 300 : XY%(1,2) = 100 '
'
tP.Colour = 14 ' yellow is a warm color
IF fComputeArc?( tP, XY%() ) THEN
CIRCLE (tP.X,tP.Y),tP.Radius,tP.Colour,tP.StartRad,tP.EndRad
ELSE
PRINT "Can't draw that puppy!"
BEEP
END IF
WHILE NOT INSTAT : WEND
CLS
SCREEN 0