home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY1 / EXAMP1.ZIP / RMEX290.BAS < prev    next >
BASIC Source File  |  1990-04-03  |  519b  |  18 lines

  1. SCREEN 1                     'set med-res graghics mode
  2. pi = ATN(1) * 4              'calculate pi
  3. VAL1 = 5
  4. VAL2 = 6
  5. steps = 400
  6. WINDOW (-1,1) - (1,-1)        'orgin at middle
  7. ' go around the circle once
  8. FOR theta = 0 TO 2 * pi STEP 2 * pi/steps
  9.   'circles with unity radius
  10.   radius = COS(2 * theta)
  11.   'translate to Cartesian
  12.   x = radius * COS(VAL1 * theta)
  13.   'coordinates with a twist
  14.   y = radius * SIN(VAL2 * theta)
  15.   PSET(x,y)                  'set a pixel
  16. NEXT theta
  17. WHILE NOT INSTAT : WEND
  18. END