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
/
GN4POLY.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 GN4Line (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL Y2%)
DEFINT A-Z
SUB GN4Polygon (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!) * 1.2 + x
y1 = r! * SIN(ang! + dang!) + y
FOR DrawLine = 1 TO vertices
ang! = ang! - delta!
x2 = r! * COS(ang! + dang!) * 1.2 + x
y2 = r! * SIN(ang! + dang!) + y
GN4Line x1, y1, x2, y2
x1 = x2
y1 = y2
NEXT
END IF
END SUB