%! PostScript

People seem to have a low respect for PostScript, thinking it's just a language used by printers to draw text, lines and the occasional squiggly line, but it is very powerful and quite intelligent. It is a stack based language, beyond being Turing complete, has a large set of curve drawing and mathematical operators. Hmm, sounds like a perfect place to draw math related stuff.

A First Guide to PostScript is a great introduction and PostScript Index has an exhaustive list of functions.

3D Attractors
Lorenz Attractor

A representation of fluid dynamics as defined by dx/dt = ρ(y - x), dy/dt = -x z + σx - y, dz/dt = x y - βz

Follow Link Follow Link
Rössler

A model for certain chemical reactions as defined by dx/dt = z - y, dy/dt = x + a y, dz/dt = b + z (x - c).

Follow Link Follow Link

These are sets of differential equations which are attracted to certain regions and remain bounded by them. They are representations of physical systems.

2D Attractors
Duffing Attractor

A representation of a mechanical oscillator as defined by dx/dt = y and dy/dt = x3 - x - αy + f cos(ωt).

Follow Link Follow Link
Hénon Attractor

A mapping defined by (x, y) → (1 + y - αx2, βx).

Follow Link Follow Link
Lozi Attractor

A mapping defined by (x, y) → (1 + y - α|x|, βx).

Follow Link Follow Link
いけだ (Ikeda) Attractor

A mapping defined by (x, y) (1 + u (x cos θ - y sin θ), u (y sin θ + y cos θ)) where θ = 0.4 - 6/(1 + x2 + y2).

Follow Link Follow Link

These are mappings that are also attracted to certain regions and are bounded.

Matthias Wandel's Transcendental Formula Art
Flower #1

A lotus-like flower.

Follow Link Follow Link
Flower #2

A daisy-like flower.

Follow Link Follow Link
Shingles

An interlocking scallop pattern.

Follow Link Follow Link
Slinky

A sort of toroidal spring shape.

Follow Link Follow Link
Waves

An undulating sheet pattern.

Follow Link Follow Link

I stumbled across Matthias Wandel's site and I came across a number of neat looking transcendental formula art, as he termed it, and I have ported them from QuickBasic to PostScript.

Lindenmayer Systems
Arrowhead Curve

This an L-system defined by { X Y, F + -, X, X → YF+XF+Y; Y → XF-YF-X } with an angle of 60°.

Follow Link Follow Link
Dragon Curve

This is an L-system defined by { X Y, F + -, FX, X → X+YF+; Y → -FX-Y }.

Follow Link Follow Link
Hilbert Curve

This is an L-system defined by { X Y, F + -, X, X → +YF-XFX-FY+; Y → -XF+YFY+FX- }.

Follow Link Follow Link
Koch Curve

This is an L-system defined by { F + -, F, F → F+F--F+F } with an angle of 60°. It is implemented with similar syntax to rlineto.

Follow Link Follow Link
Peano Curve

This is an L-system defined by { F + -, F, F → F+F-F-F-F+F+F+F-F } . It is implemented with similar syntax to rlineto.

Follow Link Follow Link
Peano-Gosper Curve

This is an L-system defined by { X Y, F + -, X, X → X+YF++YF-FX--FXFX-YF+; Y → -FX+YFYF++YF+FX--FX-Y }.

Follow Link Follow Link
Penrose Tiling

This is an L-system defined by { W X Y Z F, + - [ ], [X]++[X]++[X]++[X]++[X], W → YF++ZF----XF[-YF----WF]++; X → +YF--ZF[---WF--XF]+; Y → -WF++XF[+++YF++ZF]-; Z → --YF++++WF[+ZF++++XF]--XF; F → }.

Follow Link Follow Link
Sierpinski Gasket

This an L-system defined by { X Y, F + -, X, X → --FXF++FXF++FXF--; F → FF } with an angle of 60°.

Follow Link Follow Link
Square Curve

This is an L-system defined by { X, F + -, XF+F+X, X → XF-F+F-XF+F+XF-F+F-X }.

Follow Link Follow Link

Lindenmayer systems started as a way to model the growth of algae, but now can be used to describe many familiar fractal-like curves, such as the Koch curve and the space-filling Peano curve.

Miscellaneous
ClipStar

A toy example to play with fonts and clipping. Produces pretty output.

Follow Link Follow Link
Fern

An itterated function system to draw a fern frond.

Follow Link Follow Link
Nautilus

A nautilus shell drawn using the Fibonacci sequence.

Follow Link Follow Link

If you are using Windows, you will probably have to get GSView to view these files. If you are lucky enough to be using UN*X, then use GhostScript/GhostView to see these. Or, if you have a PostScript printer, you can feed these files directly to the printer. Don't do that in a public lab! That's just rude!

Neat Things I Didn't Write
Calendar

Very nice calendar drawing program.

Follow Link
Draft Watermark

For putting DRAFT on the back of pages with extra incentive.

Follow Link
Font Sheets

Prints all the fonts available to a printer.

Follow Link
Replace

Once resident in a printer's memory, it replace one word for another until the power is cycled.

Follow Link

Links

Other PS Programs
Celtic Knot Thingy

A TCL program which generates PS to draw Celtic-style knot work patterns.

Follow Link
Life in PostScript

Game of Life in PostScript.

Follow Link
PS HTTPD

A web server written in PostScript.

Follow Link
PostScript Fractals

A variety of fractals in PostScript.

Follow Link
Documentation
A First Guide to PostScript

Very good primer and list of basic commands.

Follow Link
PostScript Index

Thorough list of commands.

Follow Link
PostScript Reference

Adobe's full PostScript language reference.

Follow Link
Tutorial and Cookbook

Nice tutorial and reference.

Follow Link
Software
Adobe

Created PostScript and owns the PS Logo.

Follow Link
GSView

Windows front-end to GhostScript.

Follow Link
GhostScript

Open Source PS interpreter.

Follow Link

If you have some bizarre iterative function, I'd love to try to draw it using PS, not that I can guarantee I can. :-)

Tue, 1 Jun 2010 21:26:46 -0400 View History