Spirals in Postscript — Polar Coordinates and Postscript Are Mates —

Spirals in Postscript — Polar Coordinates and Postscript Are Mates —

Kees van der Laan NAJAAR 2015 87 Spirals in PostScript — Polar Coordinates and PostScript are mates — Abstract Curves specified in Polar Coordinates can be elegantly programmed in PostScript withthe rotate command; which performs rotations in User Space. This has been shown for the Car- dioid, the Limaçon, the Lemniscate, the Archimedes and the Growth spiral. The Gyre-logo has been analyzed and imitated in PostScript. Printing of text along spiral-like belts on a sphere in the projection plane has been done, yielding poor man’s typesetting text on a sphere in projection. Keywords Acrobat Pro, Adobe, art, BLUe, Cardioid, ConTEXt, Cornu, EPSF, Escher, FIFO, folium Descartes, function-grapher previewer, Gyre-logo, hidden lines, IDE (Integrated Development Environment), Jackowski, Lauwerier, Lemniscate, LIFO, Limaçon, Mathematica, MetaPost, Metafont, minimal encapsulated PostScript, minimal mark-up, minimal plain TeX, Photo- shop, polar coordinates, projection, PSlib, PSTricks, PSView, rotation of US, Ryćko, Spirals, spherical spiral, TEXworks, Voss. Prologue When a curve is specified by Polar Coordinates, , the curve is usually drawn by connecting the Cartesian data , parametric in . {휃, 푟} Folium of Descartes is specifiedu� byu� theu� u�equation u� u�u� u� . u� When I considered how to plot(푥 this, 푦 )folium, = (푟 cos it 휃 was, 푟 notsin 휃clear) to me how to휃 begin. 3 3 Using the Cartesian data 푥 + 푦, parametric+ 3푎푥푦 = 0 in , yielded the compact one-sweep drawing. u� u� (푥u�, 푦u�) = (푟u� cos 휃u�, 푟u� sin 휃u�) 휃u� ∈ [−30, 120] %!PS-Adobe-3.0 EPSF-3.0 ... Polar Coordinates /foliumDescartes{/3a 30 def /r {3a t sin t cos mul mul t sin dup dup mul mul t cos dup dup mul mul add div} def %radius vector /t -30 def r t cos mul r t sin mul moveto%start left up Asymptote푟u� = 3푎3 sin 휃 cos3 휃 . -30 2 120{/t exch def %to right under sin 휃 + cos 휃 r t cos mul r t sin mul lineto}for stroke } bind def 푥 + 푦 + 푎 = 0 A curve specified by polar coordinates can sometimes be programmed in PostScript without the calculation of the intermediate Cartesian coordinates, , exploiting the fact that PostScriptperforms rotations in User Space. Examples A Cardioid is defined in polar coordinates by {푥, 푦}, [0, ]. A version of the more general Limaçon, with parameter b=.25, , [0, ] is included at right. 푟 = 2푎(1+cos(휃)) 휃 ∈ 2휋 푟 = 2푎(푏 + cos(휃)) 휃 ∈ 2휋 88 MAPS 46 Kees van der Laan %!PS-Adobe-3.0 EPSF-3.0 %%Title: Cardioid in Polar Coordinates %%BoundingBox: 0-30 -41 30 %%BeginSetup %%EndSetup /t 0 def /2a -20 def 2 2a mul 0 moveto 120{3 rotate /t t 3 add def 2a 1 t cos add mul 0 lineto}repeat Cardioid stroke showpage Limaçon Without the use of the rotation of US facility the coding of the loop would read 0 3 360{/theta exch def /r 2a 1 t cos add mul def r theta cos mul r theta sin mul lineto}for The difference is ‘r theta cos mul r theta sin mul lineto’ versus ‘r 0 lineto’. Irrelevant details?1 The Lemniscate is defined in polar coordinates by , a parameter.2 2 2 %!PS-Adobe-3.0 EPSF-3.0 푟 = 2푎 cos(2휃), |휃| ≤ 휋/4 푎 %%Title: Lemniscate in Polar Coordinates %%BoundingBox: -15 -6 15 6 %%BeginSetup %%EndSetup /lemniscate{2{gsave -45 rotate /asqrt2 14.142 def 0 0 moveto -84 6 84{/2t exch def 3 rotate asqrt2 2t cos sqrt mul 0 lineto}for 0 0 lineto stroke grestore -1 1 scale}repeat%left branch mirrored Lemniscate }bind def In my ‘Julia fractals’-paper, EuroTEX2012 I showed that the Cardioid could also have been drawn by Mathematica via ParametricPlot. Mathematica has plot variants: Pot, PolarPlot, ParametricPlot, Plot3D, PlotContour, In Mathematica the Lemniscate can be plotted by PolarPlot[2 Sqrt[Cos[2t]], 3 {t,0,}$\pi$\type{/4}]. … My MF code for the Lemniscate of the mid-90s is longer. In the Archimedes and the Growth spiral the next radius vector is obtained by only one addition casu quo one multiplication. Stylistic and trigonometric stylistic flower I consider Stylistic and trigonometric styl- istic flowers nice examples of using PS’ US rotation. I have overlooked the influence sin has on the radius vector in Polar Coordinates. At right the picture with sin(6 ). I have decoupled the number 6 from the number of petals. %!PS-Adobe-3.0 EPSF-3.0 %!PS-Adobe-3.0 EPSF-3.0 휃 %%Title: Stylistic flower 0 0 moveto /dtheta 2 def /a 100 def%scaling %%BoundingBox: -26 -26 26 26 10{gsave%one leaf %%BeginSetup dtheta dtheta 30{%points per leaf; %%EndSetup /6theta exch 6 mul def%30*6=180 /flower{/r 18 def a 6theta sin mul 0 lineto 10 {0 r r 270 360 arc dtheta 2 mul rotate%2 thickness leaf r 0 r 90 180 arc }for stroke 36 rotate} bind grestore repeat stroke 36 rotate%number of leaves 36*10=360 } bind def }repeat showpage Stylistic trig. Stylistic flower flower For Lauwerier’s BASIC code of an intriguing trigonometric stylistic flower, and my PS translation, see Appendix 2. Rotation symmetric Julia fractals may also yield stylistic flowers, see Julia Fractals in PS,E EuroT X2012. Stylistic flowers enriched by colours have been shown in my ‘Recreational use of TEX’, EuroTEX2012. Spirals in PostScript NAJAAR 2015 89 Introduction While catching up with font developments in the (TEX) world in the 21 century, I learned about the OTF TEX-Gyre-project for fonts to be used by AllTEX engines. TheE T X-Gyre-logo drew myu�u� attention, especially the spiral. In a comment on my ‘Recreational use of TEX&Co’-paper Jack- owski reminded me of the Toruń1998-logo, which displays a belt with text on a sphere. TEX-Gyre-logo Enough for paying attention to Spirals in PostScript. Toruń1998-logo Archimedes and Growth Spiral The Archimedes Spiral, in polar coordinates, is defined by . The Growth Spiral is in polar coordinates defined byln or e . u� 푟 = 푘휃, 0 ≤ 휃 < ∞ u�u� If we draw the curves by piecewise straight lines connecting푟u� the= 푘휃 푟u� =, with, equidistant, then we have the following properties for the discrete radius vectors −∞ < 휃4 < ∞ u� . {휃u�, 푟u�}u�=1 u� Archimedes Spiral: , , an arithmetic series. The spiral for 휃 u� {푟finiteu�}u�=1 is finite. The grooves are equidistant. u�+1 u� 푟 = 푟 + 푘Δ휃 푖 = 1, …∞ %!PS-Adobe-3.0 EPSF-3.0 휃u�u�u� %%Title: Archimedes Spiral %%BoundingBox: -56 -59 54 55 %%BeginSetup %%EndSetup /archimedesspiral{0 0 moveto /f .1 def /r 0 def 555{5 rotate /r r f add def r 0 lineto}repeat stroke }bind def % archimedesspiral Growth Spiral: e , , a geometric series. The spiral for finite is infinite. Rotation yields the same spiral; the spiral is self-similar. u�Δu� u�+1 u� 푟 = 푟 −∞ < 푖 < ∞ %!PS-Adobe-3.0 EPSF-3.0 휃u�u�u� %%Title: Growth Spiral %%BoundingBox: -100 -110 75 86 %%BeginSetup %%EndSetup /growthspiral{1 0 moveto%off the 0 /f 2.718 .0085 exp def /r 1 def 555{5 rotate /r r f mul def r 0 lineto}repeat stroke }bind def % growthspiral Appendix 1 contains Lauwerier’s BASIC programs for these spirals using Cartesian coordinates. My most beautiful Growth spiral is the -decimals picture. The decimals are printed along an implicit growth spiral because of the scaling and the rotation of User Space. The disk of radius 1 has surface . 휋 휋 90 MAPS 46 Kees van der Laan %!PS-Adobe-3.0 EPSF-3.0 3.1 4 %%Title: Pi-decimals along a Spiral, cgl 2012 8 4 1 9 1 5 2 8 6 2 7 %%BoundingBox: -80 -100 100 90 0 4 0 8 6 1 9 6 0 8 6 5 1 3 2 6 2 %%BeginSetup 5 1 8 3 5 9 4 0 2 0 9 8 4 5 5 9 6 8 8 6 9 1 2 5 4 4 1 8 %%EndSetup 7 5 9 3 3 4 4 6 6 2 2 3 7 0 5 4 5 6 4 1 2 8 9 2 1 6 1 8 5 7 1 9 6 0 7 2 6 0 5 2 2 3 0 6 0 3 8 1 5 2 2 6 8 4 9 /Symbol 26 selectfont 1 9 9 8 0 9 8 5 4 3 6 0 0 1 1 9 4 6 9 3 3 7 0 1 1 6 0 3 2 9 4 0 1 1 9 5 9 8 2 3 1 3 8 1 9 3 2 4 3 0 9 7 5 4 7 6 3 0 1 4 8 9 1 9 7 2 0 1 3 3 2 1 5 2 3 1 1 9 1 0 4 9 8 8 6 7 6 2 9 6 3 5 5 1 5 9 8 8 9 2 5 2 3 5 1 8 2 9 0 1 7 . 1 -18 moveto (p) show%p denotes pi in symbol font 2 6 2 . 7 5 5 8 8 2 1 4 0 6 9 7 8 9 4 4 2 1 6 2 7 6 0 1 0 7 2 6 1 4 8 3 6 3 3 3 3 7 9 4 4 5 5 3 8 1 6 3 4 9 π 5 8 6 5 2 3 2 1 0 7 6 9 3 1 5 6 5 9 2 0 7 8 5 1 8 4 6 2 3 4 6 0 5 6 8 4 3 6 2 5 4 0 5 1 6 2 9 2 7 1 9 4 2 9 4 6 7 5 /Helvetica 20 selectfont 8 0 3 7 8 6 0 7 5 8 9 8 3 4 7 6 1 5 1 8 1 2 4 0 0 3 4 3 3 8 7 0 8 4 8 0 7 6 5 0 0 5 4 5 3 7 6 7 8 5 9 1 3 0 0 9 2 0 70 moveto (3) show 1 0 rmoveto (.) show -2 0 rmoveto 9 2 4 0 5 8 1 1 4 3 1 3 9 8 3 0 1 4 4 6 4 4 7 0 2 8 -10 rotate .995 dup scale 4 9 2 4 3 5 5 9 4 8 7 6 2 9 0 3 {pop pop -10 rotate 3 0 rmoveto .995 dup scale} 2 2 6 3 4 8 (3.141592653589793238462643383279502884197169399375\ ...) kshow showpage More nice Growth spirals appear in the shrinking squares picture.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us