PATOO: Program for the Application of Translations and Other Operators

Last Update: Dec 2003.

Would you like to know how was this image done? Just a few lines of code in a new geometric description language: PATOO. It has been created and developed by Javier Rodríguez Laguna [jrlaguna(a)sissa.it].

PATOO is an independent program at this stage, but it shall be inserted into GDL in due time (i.e.: when I have time, or sooner if you help me :-). A gallery of PATOO images made by high-school students is available here.


Two objects are basic to PATOO: figures and operators. A figure is any image you may imagine. OK, OK, not just any image. Just anyone composed of circles and segments by now. A figure is declared this way:

r=(0,0)(10,10)(15,10)

This creates a multiple segment from point (0,0) to point (10,10) to point (15,10) and loads it into figure r. Of course, you may add as many points as you want. If you want to show it on a screen, just do this

r

The other main figure type is the circle: C(10,15,4) draws a circle centered at (10,15) of radius 4.

Figures may be added: r=(0,0)(10,10)(15,10)+C(10,15,4) yields on the same figure the segments and the circle.


The other main ingredient to PATOO are operators. The following ones are defined:

Operators may be multiplied, which just means consecutive operation. They may also be raised to any power writing A^n. But they may also be added: A+B acting on a given figure f yield Af+Bf: two copies of the figure, once affected by A and the other one affected by B.


Now that you know the basics of the PATOO language you may understand the first program:


#
# A smiley. By the way: # marks a comment
#
r=C(50,50,50)+(40,60)(40,50)+(60,60)(60,50)+(30,25)(70,25)
#
# The basic operator
#
A=S(0.5)+S(0.5)*T(100,0)+S(0.5)*T(50,86)
#
# Which is raised to the fifth power
#
C=A^5
#
# And applied on poor smiley
#
s=C*r
#
# We scale it up 4 times and translate it leftwards and downwards so
# as it is correctly viewed.
#
print T(-200,-200)*S(4)*s
#
quit

I came up with the idea of PATOO when I was working on my PhD in theoretical physics. My work involved building a program to deal with operators acting on many-body quantum states. The formalism and the code which was developed was directly suitable for a geometry program, so I adapted it (once the PhD defense was over, of course :-).

If you have reached this page without going through GDL, I recommend you to press here.