Article View: comp.sys.next.programmer
Article #2347Re: Arcs and circles from curveto
From: Henry McGilton
Date: Tue, 12 Jan 1993 17:51
Date: Tue, 12 Jan 1993 17:51
33 lines
1791 bytes
1791 bytes
In article <1993Jan11.014246.4735@drefla.mese.com> matt@drefla.mese.com (Matt
Brandt) writes:
* I've been able to come up with a pretty good approximation
* of a circle using curveto . . .
<<<<< stuff deteleted >>>>>>
* of course, you can repeat for the bottom of the circle.
* Like I said though, this is only an approximation. Does
* anybody out there have a better approximation of circle
* drawing using curveto? I need to do it this way for bizarre
* reasons and I would like to improve the accuracy a little bit.
You can't get an accurate enough circle with only two curves. You
need one curve per quadrant, and you draw four of them. The ``magic
number'' for the circle is 0.555. Here's an example which you
can hack to your needs.
%!PS
/R 288 def
/M R 0.555 mul def
306 396 translate
R 0 moveto
R M dup R dup 0 exch curveto
M neg R dup neg M R neg 0 curveto
R neg M neg dup R neg dup 0 exch curveto
M R neg R M neg R 0 curveto
closepath
stroke
I cross posted this to comp.lang.postscript, because, as Eric Scott
pointed out, this topic is pure PostScript and only tangentially
NeXT related.
........ Henry
Technical Details
Message-ID:
<1993Jan12.175132.27149@trilithon.mpk.ca.us>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!netcomsv!netcomsv!trilithon!henryReferences:
<1993Jan11.014246.4735@drefla.mese.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer,comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!netcomsv!netcomsv!trilithon!henry From: henry@trilithon.mpk.ca.us (Henry McGilton) Subject: Re: Arcs and circles from curveto Message-ID: <1993Jan12.175132.27149@trilithon.mpk.ca.us> Sender: henry@trilithon.mpk.ca.us Organization: Trilithon Software References: <1993Jan11.014246.4735@drefla.mese.com> Date: Tue, 12 Jan 1993 17:51:32 GMT Lines: 33