home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / CNC11TP.ZIP / DEMOPARA.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-01-19  |  1.6 KB  |  55 lines

  1. { Copyright (C) 1989 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
  2.  
  3. program StrokeParabolaDemo ;
  4.  
  5.      {    DemoPara - draw parabola with given radii and     }
  6.      {               and specified rotation angle          }
  7.  
  8. uses GRAPH ;
  9.  
  10. {~~~~~~~~~~~~~~~~~~~~ parabola routines ~~~~~~~~~~~~~~~~~~~~}
  11.  
  12. {$I conic.pas }
  13.  
  14. {-$I paramb.pas }
  15. {$I parambr.pas }
  16. {-$I parara.pas }
  17. {-$I pararaf.pas }
  18.  
  19. {~~~~~~~~~~~~~~~~~~~~~ main program ~~~~~~~~~~~~~~~~~~~~~~~}
  20.  
  21. var
  22.    grDriver, grMode : integer ; { graph control parameters }
  23.    p                : word ;    { parabola parameter }
  24.    xf, yf           : integer ; { parabola center - focus }
  25.    ta, tad          : single ;  { rotation angle }
  26.  
  27. begin
  28.                                 { prompt for radius }
  29.    repeat
  30.       write ('Parameter: ') ;
  31.       readln (p)
  32.    until (p > 0) ;
  33.                                 { prompt for rotation angle }
  34.    repeat
  35.       write ('Rotation angle (deg): ') ;
  36.       readln (tad)
  37.    until (tad >= 0.0) and (tad < 360.0) ;
  38.    ta := tad / 180.0 * Pi ;
  39.                                 { initiate graphics }
  40.    grDriver := Detect ;
  41.    InitGraph(grDriver,grMode,'') ;
  42.                                 { center of display }
  43.    xf := (GetMaxX + 1) div 2 ;
  44.    yf := (GetMaxY + 1) div 2 ;
  45.                                 { draw parabola }
  46.    StrokeParabola(xf,yf,p,ta) ;
  47.                                 { leak test }
  48.    FloodFill(xf,yf,GetMaxColor) ;
  49.                                 { pause }
  50.    readln ;
  51.    CloseGraph
  52. end.
  53.  
  54. { Copyright (C) 1989 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
  55.