\input pstricks
\input fp
\FPmessagesfalse
\input vec2d
\input pst-plot
\parindent=0pt
\parskip=10pt

\def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials}
\def\listing#1{\par\begingroup\setupverbatim\input#1 \endgroup}
\def\setupverbatim{\parskip=0pt\tt
  \obeylines \uncatcodespecials \obeyspaces
}%
{\obeyspaces\global\let =\ }

{\tt vec2d} is a package to draw two dimensional mathematical figures. Needed {\tt fp.tex} (fixed point math package) and {\tt pstricks.tex}.

A picture consists of:\hfil\break

- a list of definitions and calculations of points and lines

- the start of drawing: {\tt \string\VDDdcanvas} or {\tt \string\VDDdmincanvas}

- drawing and labeling operations and possibly additional definitions and calculations

- and end marker {\tt \string\VDDdcanvasend } or {\tt \string\VDDdmincanvasend}

Points can be named {\tt A-Z} with any number of accents ({\tt '}). {\tt \string\VDDdef} is used to define points in cartesian and polar coordinates.
A comma signifies cartesian and a semicolon polar (in degrees).

Example: {\tt \string\VDDdef\ O(0,0)A(3,1)B'(4;45)} defines the points $O(0, 0)$, $A(3, 1)$ and $B'(r = 4, \phi = 45^\circ)$.

A complete example

\def\same#1{%
  \vskip0.3cm
  \listing{#1}\par
  \input #1\par
  \vfil
  \eject
}%

\same{ex01}

Several commands are available to construct triangles

\same{ex02}

Special lines in triangles. If you want to know the intersection of two lines, you need to calculate it.

\same{ex03}

More special lines in triangles.

\same{ex04}

More special lines in triangles.

\same{ex05}

Similar triangles

\same{ex06}

Fake 3d drawing with translate.

\same{ex07}

Fake 3d drawing with translate (polar coordinates with custom origin)

\same{ex08}

Example of 'real world' construction

\same{ex09}

Find intersection of line and circle

\same{ex10}

Parabola with focus and directrix.

\same{ex11}

Convenience functions to find tangents and place labels at lines, circles and intersections of those.

\same{ex12}

Multiplication wrt point.

\same{ex13}

Ellipses

\same{ex14}

Regular polygons

\same{ex15}

Making parametric plots etc. Functions are written in postscript notation (the operator comes after the operands). So "x x *" means "x * x" and "2 5 x * +" means "5 * x + 2".

\same{ex16}

Plotting functions and areas.

\same{ex17}

\bye
