Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 06 Apr 2016 09:37:39 -0500 From: Scott Hemphill Newsgroups: comp.lang.postscript Subject: Re: How does 'arc' work? References: <356283f9-d422-4515-8bd6-5ad0cf625f07@googlegroups.com> <2240fb7d-ff33-4281-b837-a2b119198179@googlegroups.com> <87zitaycui.fsf@hemphills.net> Reply-To: hemphill@alumni.caltech.edu Date: Wed, 06 Apr 2016 10:37:39 -0400 Message-ID: <877fgals5o.fsf@hemphills.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:i4F7FFZKmYVowr3gRQOvF/c+DgM= MIME-Version: 1.0 Content-Type: text/plain Lines: 99 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-jiQE2CYUZcYLpZpRGDvFHqlfS45r/RBrpRFUL8sgWfuuhBkG/JAg7UTqqWvOMxVqKwl3sqsVbnjOg+O!hFoyzbaRMEwPUyuZ32ypdLyxHqLzDgqhbyaGoTJzLWS9rNehTPleVhQ= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3534 X-Received-Bytes: 3646 X-Received-Body-CRC: 1598859170 Xref: csiph.com comp.lang.postscript:2495 luser- -droog writes: > On Sunday, April 3, 2016 at 9:40:55 AM UTC-5, Scott Hemphill wrote: > >> For real PostScript? Feed this to your printer. Modify it as desired. >> >> ======================================================================== >> %!PS >> >> % What is the distance of an inner Bezier curve control point to the outer >> % point as a function of angle in an "arc" operator >> >> /dist >> { >> /angle exch def >> gsave >> newpath >> 0 0 1000 0 angle arc >> {pop pop} {pop pop} {pop pop pop pop exch pop} {} pathforall >> grestore >> 1000 div >> } >> bind def >> >> /tmpstr 20 string def >> >> % I use paper size "letter" >> >> /in { 72 mul } bind def >> /Times-Roman findfont 10 scalefont setfont >> /lineskip 12 def >> /nl { 1 in y moveto /y y lineskip sub def } bind def >> /y 10 in def >> nl >> >> 10 10 90 { dup tmpstr cvs show ( ) show dist tmpstr cvs show nl } for >> >> showpage >> ======================================================================== >> > > Very cool. There may indeed be something wrong with my implementation. > > gs gives: > 10 0.0582147 > 20 0.11665 > 30 0.175536 > 40 0.235099 > 50 0.295591 > 60 0.357264 > 70 0.420398 > 80 0.485293 > 90 0.552282 > > whereas xpost gives: > 10 0.115506 > 20 0.231321 > 30 0.346987 > 40 0.461987 > 50 0.575741 > 60 0.687515 > 70 0.796415 > 80 0.901347 > 90 1.000998 I changed the above program to make an arc with radius 1024 instead of 1000 so that presumably the processor can do the division with no additional roundoff error. My HP LaserJet Pro M452dw gives: 10 0.0582143 20 0.116652 30 0.175537 40 0.235103 50 0.295593 60 0.357266 70 0.420398 80 0.485294 90 0.55228 There is something funky going on with small radii, which is why I used a larger radius to begin with. If I change the radius from 1024 to 1, I get this: 10 0.0582886 20 0.116699 30 0.175537 40 0.235107 50 0.295593 60 0.357239 70 0.42041 80 0.485291 90 0.552307 Scott -- Scott Hemphill hemphill@alumni.caltech.edu "This isn't flying. This is falling, with style." -- Buzz Lightyear