home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
b
/
baswiz19.zip
/
BW$BAS.ZIP
/
G0POLY.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-01-29
|
1KB
|
31 lines
' +----------------------------------------------------------------------+
' | |
' | BASWIZ Copyright (c) 1990-1993 Thomas G. Hanlin III |
' | |
' | The BASIC Wizard's Library |
' | |
' +----------------------------------------------------------------------+
DECLARE SUB G0Line (BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%)
DEFINT A-Z
SUB G0Polygon (X, Y, Radius, Vertices, Angle!)
IF Vertices > 1 THEN
ang! = 6.283185
dang! = -Angle!
r! = Radius
delta! = ang! / CSNG(Vertices)
x1 = r! * COS(ang! + dang!) * 2! + x
y1 = r! * SIN(ang! + dang!) + y
FOR DrawLine = 1 TO vertices
ang! = ang! - delta!
x2 = r! * COS(ang! + dang!) * 2! + x
y2 = r! * SIN(ang! + dang!) + y
G0Line x1, y1, x2, y2
x1 = x2
y1 = y2
NEXT
END IF
END SUB