home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / programm / 8090 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  1.8 KB

  1. Xref: sparky comp.sys.next.programmer:8090 comp.lang.postscript:6245
  2. Newsgroups: comp.sys.next.programmer,comp.lang.postscript
  3. Path: sparky!uunet!charon.amdahl.com!netcomsv!netcomsv!trilithon!henry
  4. From: henry@trilithon.mpk.ca.us (Henry McGilton)
  5. Subject: Re: Arcs and circles from curveto
  6. Message-ID: <1993Jan12.175132.27149@trilithon.mpk.ca.us>
  7. Sender: henry@trilithon.mpk.ca.us
  8. Organization: Trilithon Software
  9. References: <1993Jan11.014246.4735@drefla.mese.com>
  10. Date: Tue, 12 Jan 1993 17:51:32 GMT
  11. Lines: 33
  12.  
  13. In article <1993Jan11.014246.4735@drefla.mese.com> matt@drefla.mese.com (Matt  
  14. Brandt) writes:
  15.     *  I've been able to come up with a pretty good approximation
  16.     *  of a circle using curveto . . .
  17. <<<<<   stuff deteleted  >>>>>>
  18.     *  of course, you can repeat for the bottom of the circle.
  19.     *  Like I said though, this is only an approximation. Does
  20.     *  anybody out there have a better approximation of circle
  21.     *  drawing using curveto? I need to do it this way for bizarre
  22.     *  reasons and I would like to improve the accuracy a little bit.
  23. You can't get an accurate enough circle with only two curves.  You
  24. need one curve per quadrant, and you draw four of them.  The ``magic
  25. number'' for the circle is  0.555.  Here's an example which you
  26. can hack to your needs.
  27.  
  28.             %!PS
  29.             /R 288 def
  30.             /M R 0.555 mul def
  31.             306 396 translate
  32.             R 0 moveto
  33.             R M dup R dup 0 exch curveto
  34.             M neg R dup neg M R neg 0 curveto
  35.             R neg M neg dup R neg dup 0 exch curveto
  36.             M R neg R M neg R 0 curveto
  37.             closepath
  38.             stroke
  39.  
  40. I cross posted this to comp.lang.postscript, because, as Eric Scott
  41. pointed out, this topic is pure PostScript and only tangentially
  42. NeXT related.
  43.  
  44.  
  45.         ........  Henry
  46.