home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / baswiz / bw_bas / g1poly.bas < prev    next >
BASIC Source File  |  1992-08-29  |  1KB  |  31 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        BASWIZ  Copyright (c) 1990-1992  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      The BASIC Wizard's Library                      |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    DECLARE SUB G1Line (BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%)
  10.  
  11.    DEFINT A-Z
  12.  
  13. SUB G1Polygon (X, Y, Radius, Vertices, Angle!)
  14.    IF Vertices > 1 THEN
  15.       ang! = 6.283185
  16.       dang! = -Angle!
  17.       r! = Radius
  18.       delta! = ang! / CSNG(Vertices)
  19.       x1 = r! * COS(ang! + dang!) * 1.2 + x
  20.       y1 = r! * SIN(ang! + dang!) + y
  21.       FOR DrawLine = 1 TO vertices
  22.          ang! = ang! - delta!
  23.          x2 = r! * COS(ang! + dang!) * 1.2 + x
  24.          y2 = r! * SIN(ang! + dang!) + y
  25.          G1Line x1, y1, x2, y2
  26.          x1 = x2
  27.          y1 = y2
  28.       NEXT
  29.    END IF
  30. END SUB
  31.