Version 1.0. Authors: Olivier Landemarre & Claude AI opus 5.5.
Blitz Math 3D draws curves, surfaces and volumes described by formulas, in three dimensions. You type a formula, choose the domain, and the object appears in a GEM window, where you turn it with the mouse, set the light, the colors, a section… before saving your document or exporting the image.
Contents:
| File | Role |
|---|---|
MATH3D.PRG | the full version, for a 68030 or better with a coprocessor (FPU) |
MATH3D60.PRG | the same full version, for the 68060 (CT60, CT63, Hades, Milan…) |
MATH3DCF.PRG | the same full version, for the ColdFire V4e of the FireBee |
MATH3DL.PRG | the light version, for a 68000 without coprocessor |
MATH3D.RSC | the resource (menus, boxes, texts), in French |
RSRC\MATH3D<n>.RSC | the resource in the other languages |
EXAMPLES\ | example documents, 8.3 names for TOS (section 11) |
EX_LONG\ | the same, with their original names (MiNT, MagiC, Linux) |
MANUAL.TXT, MANUAL.PDF | this manual; MANUEL.TXT and MANUEL.PDF in French |
LISEZMOI.TXT | the content of the archive, in short |
Copy everything into one folder, keeping MATH3D.RSC and the RSRC folder next to the programs. At startup, the program takes the resource of the system language (English, German, Spanish, Portuguese, Catalan, Italian, Dutch, Swedish, Norwegian, Danish, Finnish, Czech, Hungarian, Polish, Romanian, Greek) if it is in RSRC, otherwise MATH3D.RSC, in French. This manual uses the names of the English resource.
The language comes from the AES. MyAES follows the country code saved in the NVRAM (and loads the resource of that code by itself); XaAES, the one of its configuration. Portuguese (code 35) and Catalan (54) are thus picked up automatically there. TOS and EmuTOS do not report the language: to force one, copy its resource over MATH3D.RSC, for example RSRC\MATH3D0.RSC for US English or RSRC\MATH3D35.RSC for Portuguese.
Czech, Hungarian, Polish, Romanian and Greek are written in the system font of their country (Kamenický, Latin-2, Greek), the one a machine set up for that country has. Copied onto a machine with the Western European font, these resources would show wrong letters.
The program writes a small file next to itself, MATH3D.CFG: the list of recent files.
MATH3D.PRG (full) | MATH3DL.PRG (light) | |
|---|---|---|
| Processor | 68030 or better, with FPU (Falcon + 68882, TT, CT60, V4SA…) | any Atari, 68000 included (ST, STE, Mega ST, basic Falcon) |
| Memory | 2 MB minimum | 2 MB minimum |
| Screens | from monochrome to True Color | from monochrome to 256 colors, Falcon 16 bits (not the 24 and 32-bit modes nor the Intel byte order of graphics cards) |
| Computing | in floating point | in fixed point for interaction, fast without FPU |
On a 68060 (Falcon with CT60 or CT63, Hades, Milan…), take MATH3D60.PRG: the full version compiled for that processor. The 68060 no longer has some coprocessor instructions in hardware (sine, exponential, logarithm…): MATH3D60.PRG computes them itself, without going through the system's slow emulation. On a 68060, MATH3D.PRG also works, but more slowly.
On the FireBee, take MATH3DCF.PRG: it is the full version, compiled for its ColdFire V4e processor and its coprocessor. It does everything MATH3D.PRG does, command line included.
The light version does everything needed to draw the "classic" curves and surfaces: explicit, parametric, polar, cylindrical, spherical curves, meridians; parametric, spherical, revolution surfaces, graphs; implicit curves and isosurfaces; tubes; solid faces and wireframe.
Only in the full version: differential equations, phase portraits, complex functions, vector fields, conformal maps, STL objects; color by curvature, contour lines, critical points, geodesics, Frenet frames, field lines, section by a plane, several isosurfaces; Measures, Variables, Animate a variable; the sum() function; the SAGA overlay of the V4SA.
In the light version, fog, specular highlights and smooth shading are greyed out (too slow without FPU). A document coming from the full version that uses them still opens: the option stays available, so that you can switch it off.
Both versions read and write the same document format (.ARG).
TOS, EmuTOS, MagiC, MiNT with XaAES or MyAES. The settings boxes open in windows where the AES allows it (AES 4.1 and later), and as modal boxes elsewhere.
Your first object, a saddle:
x from -2 to 2, 32 points and the same for y: keep it. Click Create.0). Choose Object > Formulas…, type x*x-y*y and confirm.orange in Object, confirm..ARG file.Each document type starts with a neutral formula (a plane, a circle, a sphere…) that you then replace with your own: it is the simplest way to see at once what the domain covers.
| Action | Effect |
|---|---|
| drag, left button | turns the object |
| Shift + drag | zooms |
| mouse wheel (if the mouse has one and the system passes it on) | zooms |
| right button | opens the context menu |
| Undo / Ctrl+Z | undoes the last change |
| Shift+Undo / Ctrl+Y | redoes |
| Ctrl+C | copies the image to the clipboard |
While you turn the object, the window shows a preview (wireframe, or solid faces if Window > Solid preview is checked); the final image is computed when you release the button.
.args document, .obj mesh.| Notation | Meaning |
|---|---|
+ - * / | the four operations |
^ | power: x^2, 2^x, x^0.5 |
% | remainder of the division |
( ) | parentheses |
< <= > >= == != | comparisons: 1 if true, 0 if false |
Numbers are written with a decimal point: 0.5, 6.283185, 1e-3.
| Function | Meaning |
|---|---|
sin cos tan | trigonometry, angles in radians |
asin acos atan | inverse functions |
atan2(y, x) | angle of the point (x, y), from −π to π |
sinh cosh tanh | hyperbolic functions |
exp | exponential |
ln | natural logarithm |
log, log10 | base-10 logarithm |
sqrt | square root |
abs | absolute value |
floor, ceil | round down, round up |
pow(a, b) | a to the power b |
fac(n) | factorial |
ncr(n, k), npr(n, k) | combinations, permutations |
min(a, b), max(a, b) | the smaller, the larger |
sign(x) | −1, 0 or 1 |
mod(a, b) | remainder of a by b |
hypot(a, b) | √(a² + b²) |
if(c, a, b) | a if c is true (non-zero), otherwise b |
sum(k, start, end, term) | sum of term for integer k from start to end (full version) |
Constants: pi (3.14159…) and e (2.71828…).
| Formula | Meaning |
|---|---|
sqrt(x*x+y*y) | distance to the origin |
if(x*x+y*y<1, sqrt(1-x*x-y*y), 0) | a half-sphere standing on a plane |
min(x, 1) | x, capped at 1 |
abs(sin(3*t)) | a "bouncing" sine wave |
sum(k,1,8,sin((2*k-1)*x)/(2*k-1)) | Fourier series of a square wave, 8 terms |
-x^2 means (-x)^2, that is +x². For −x², write -(x^2) or 0-x^2. Likewise exp(-x^2) means exp(x²): write exp(-(x^2)) or exp(-x*x).2*x, not 2x; x*y, not xy.6.283185 (2π), half a turn 3.141593. In the domain fields, type the number (pi is not read there).if, for example if(r>0, sin(r)/r, 1).sum, the bounds are integers written as digits, and the sum has at most 1000 terms.In the full version, Object > Variables… defines up to six variables (R = 4, r = 1.5…) usable in all formulas and in the section plane. See section 8.
Each type has its formulas, its variables and its domain. The domain is given in lines "from … to … points": the bounds and the number of computed points (more points: finer, but slower).
Useful values: 2π = 6.283185, π = 3.141593, π/2 = 1.570796, 4π = 12.566371, 6π = 18.849556.
Types marked ★ exist only in the full version.
Two formulas in x; the curve goes through (x, y(x), z(x)). Domain: x. Put 0 in z for a plane curve.
| Curve | y(x) | z(x) | domain x |
|---|---|---|---|
| damped sine | exp(-x/4)*sin(3*x) | 0 | 0 to 12.566371, 400 |
| Gaussian bell | exp(-x*x) | 0 | −3 to 3, 200 |
| space curve | sin(x) | cos(2*x)/2 | 0 to 6.283185, 300 |
Three formulas in t. Domain: t.
| Curve | x(t) | y(t) | z(t) | domain t |
|---|---|---|---|---|
| helix | cos(t) | sin(t) | t/4 | 0 to 18.849556, 400 |
| trefoil knot | sin(t)+2*sin(2*t) | cos(t)-2*cos(2*t) | -sin(3*t) | 0 to 6.283185, 400 |
| Viviani's curve | 1+cos(t) | sin(t) | 2*sin(t/2) | 0 to 12.566371, 400 |
| 3D Lissajous | sin(3*t) | sin(4*t) | sin(5*t) | 0 to 6.283185, 600 |
| torus knot (2, 5) | (2+cos(5*t))*cos(2*t) | (2+cos(5*t))*sin(2*t) | sin(5*t) | 0 to 6.283185, 600 |
One formula in t: the point at distance r(t) from the origin, in direction t, in a horizontal plane. Domain: t, plus the height of the plane (z plane).
| Curve | r(t) | domain t |
|---|---|---|
| circle | 1 | 0 to 6.283185 |
| cardioid | 1+cos(t) | 0 to 6.283185 |
| 5-petal rose | cos(5*t) | 0 to 3.141593 |
| Archimedean spiral | t/6 | 0 to 18.849556 |
| logarithmic spiral | exp(t/8) | 0 to 18.849556 |
| Fay's butterfly | exp(sin(t))-2*cos(4*t)+sin((2*t-pi)/24)^5 | 0 to 75.398224, 2000 |
Front view: Render > Camera…, yaw 0 and pitch 0.
Two formulas in t: distance r(t) to the vertical axis and height z(t), in direction t.
| Curve | r(t) | z(t) | domain t |
|---|---|---|---|
| helix | 1 | t/4 | 0 to 18.849556 |
| conical spiral | t/6 | t/6 | 0 to 18.849556 |
| wavy crown | 1 | 0.2*sin(8*t) | 0 to 6.283185 |
| spring with growing pitch | 1 | t*t/40 | 0 to 25.132741 |
Three formulas in t: distance to the origin, angle from the pole (theta, from 0 to π) and longitude (phi).
| Curve | r(t) | theta(t) | phi(t) | domain t |
|---|---|---|---|---|
| equator | 1 | 1.570796 | t | 0 to 6.283185 |
| clelia | 1 | t | 8*t | 0 to 3.141593, 600 |
| loxodrome | 1 | pi-2*atan(exp(t/6)) | t | −30 to 30, 1500 |
| spiral on a growing sphere | t/6 | t/2 | 4*t | 0 to 6.283185 |
One formula in u: the profile of a surface of revolution, drawn as a curve (the point at distance r(u) from the axis, at height u). Domain u, plus the angle of the meridian; checkbox x axis (else z). It is the curve that the surface of revolution (5.2) turns around the axis.
| Profile | r(u) | domain u |
|---|---|---|
| vase | 1+0.3*sin(3*u) | −1 to 1 |
| cone | u | 0 to 1 |
| drop | sqrt(1-u*u)*(1-u)/2 | −1 to 1 |
A curve can be drawn as a tube: it is an option of the document (--tube on its line, see section 9 and the examples FRENET.ARG, NOEUDTOR.ARG). In the full version, Render > Overlays… adds Frenet frames (tangent, normal, binormal) along the curve, and Render > Colors… the color by curvature or by torsion.
Three formulas in x, y, z, t: the derivatives dx/dt, dy/dt, dz/dt. The program follows the solution from a starting point (the start line of the domain), with the fourth-order Runge-Kutta method. Domain: t (duration and number of steps).
| System | dx/dt | dy/dt | dz/dt | t | start |
|---|---|---|---|---|---|
| circle | -y | x | 0 | 0 to 6.283185, 200 | 1, 0, 0 |
| helix | -y | x | 0.2 | 0 to 31.4, 800 | 1, 0, 0 |
| Lorenz attractor | 10*(y-x) | x*(28-z)-y | x*y-8/3*z | 0 to 40, 4000 | 1, 1, 1 |
| Rössler attractor | -y-z | x+0.2*y | 0.2+z*(x-5.7) | 0 to 150, 6000 | 1, 1, 0 |
| damped spiral | -0.1*x-y | x-0.1*y | 0 | 0 to 40, 800 | 2, 0, 0 |
If the trajectory looks angular, increase the number of steps.
Two formulas in x, y, t: dx/dt and dy/dt in the plane. One trajectory starts from each point of a grid (the x and y lines of the domain) and lasts the time of the t line; it stops at the edge of the window.
| System | dx/dt | dy/dt | x | y | t |
|---|---|---|---|---|---|
| center (circles) | -y | x | −2 to 2, 5 | −2 to 2, 5 | 0 to 6.283185, 100 |
| pendulum | y | -sin(x) | −6 to 6, 13 | −3 to 3, 7 | 0 to 10, 200 |
| Van der Pol | y | (1-x*x)*y-x | −3 to 3, 7 | −3 to 3, 7 | 0 to 20, 400 |
| saddle | x | -y | −2 to 2, 9 | −2 to 2, 9 | 0 to 3, 100 |
Three formulas in x, y, z: one arrow at each point of a grid (three domain lines; a line of a single point gives a plane). In Render > Overlays…, Field lines draws the lines that follow the field instead of the arrows.
| Field | Fx | Fy | Fz | grid |
|---|---|---|---|---|
| rising vortex | -y | x | 0.3 | −1 to 1 (5, 5, 3) |
| source | x | y | z | −1 to 1 (5, 5, 5) |
| pendulum (plane) | y | -sin(x) | 0 | x −4 to 4 (9), y −2.5 to 2.5 (7), z 0 to 0 (1) |
| Lorenz | 10*(y-x) | x*(28-z)-y | x*y-8/3*z | −20 to 20, −25 to 25, 5 to 45 (7 each) |
Two formulas in x, y: the real part and the imaginary part of w = f(x + iy). The program draws the image by f of the vertical (orange) and horizontal (blue) lines of the domain grid. Right angles are preserved: this is what is called a conformal map.
| f(z) | Re w | Im w | x | y |
|---|---|---|---|---|
| z² | x*x-y*y | 2*x*y | 0.2 to 1.2, 11 | −1 to 1, 11 |
| exp z | exp(x)*cos(y) | exp(x)*sin(y) | −1 to 1, 9 | −3.141593 to 3.141593, 25 |
| 1/z | x/(x*x+y*y) | -y/(x*x+y*y) | 0.5 to 2, 11 | −1 to 1, 11 |
| z³ | x^3-3*x*y*y | 3*x*x*y-y^3 | 0.2 to 1.2, 11 | −1 to 1, 11 |
A front view is advised (yaw 0, pitch 0).
Three formulas in u and v. Domain: u and v.
| Surface | x(u,v) | y(u,v) | z(u,v) | u | v |
|---|---|---|---|---|---|
| plane | u | v | 0 | −2 to 2 | −2 to 2 |
| saddle | u | v | u*u-v*v | −2 to 2 | −2 to 2 |
| sphere | cos(u)*sin(v) | sin(u)*sin(v) | cos(v) | 0 to 6.283185 | 0 to 3.141593 |
| torus | (2+cos(v))*cos(u) | (2+cos(v))*sin(u) | sin(v) | 0 to 6.283185 | 0 to 6.283185 |
| Möbius strip | (1+v/2*cos(u/2))*cos(u) | (1+v/2*cos(u/2))*sin(u) | v/2*sin(u/2) | 0 to 6.283185, 60 | −1 to 1, 10 |
| helicoid | v*cos(u) | v*sin(u) | u/2 | 0 to 12.566371 | −1 to 1 |
| Enneper surface | u-u^3/3+u*v*v | v-v^3/3+v*u*u | u*u-v*v | −2 to 2 | −2 to 2 |
| seashell | 2*(1-exp(u/18.849556))*cos(u)*cos(v/2)^2 | 2*(exp(u/18.849556)-1)*sin(u)*cos(v/2)^2 | 1-exp(u/9.424778)-sin(v)+exp(u/18.849556)*sin(v) | 0 to 18.849556, 80 | 0 to 6.283185, 24 |
| pretzel (example) | (4+1.5*cos(u)+4*cos(v*0.5)^2)*cos(2*v) | (4+1.5*cos(u)+4*cos(v*0.5)^2)*sin(2*v) | 1.5*sin(u)+4*sin(v) | 0 to 6.283185, 40 | 0 to 6.283185, 40 |
One formula in theta (angle from the pole, from 0 to π) and phi (longitude, from 0 to 2π): the distance to the origin in each direction.
| Surface | r(theta, phi) |
|---|---|
| sphere | 1 |
| bumpy sphere | 1+0.25*sin(3*phi)*sin(theta) |
| flower | 1+0.3*sin(5*phi)*sin(theta)^2 |
| harmonic (lobes) | abs(cos(theta))+0.3 |
| prolate ellipsoid | 1/sqrt(sin(theta)^2+cos(theta)^2/4) |
Advised domain: theta 0 to 3.141593 (24 to 40 points), phi 0 to 6.283185 (twice as many points).
One formula in u: the meridian turns around the axis (z by default, x if the x axis checkbox is checked). Domain: u (along the axis) and v (the angle, usually 0 to 2π).
| Surface | r(u) | u |
|---|---|---|
| cylinder | 1 | −1 to 1 |
| cone | u | 0 to 1 |
| paraboloid | sqrt(u) | 0 to 2 |
| hyperboloid | sqrt(1+u*u) | −2 to 2 |
| vase | 1+0.3*sin(3*u) | −1 to 1 |
| sphere | sqrt(1-u*u) | −1 to 1 |
| torus (one half) | 2+sqrt(1-u*u) | −1 to 1 |
One formula in x and y, the height. Domain: x and y.
| Surface | z(x, y) | domain |
|---|---|---|
| saddle | x*x-y*y | −2 to 2 |
| paraboloid | x*x+y*y | −2 to 2 |
| bell | exp(-x*x-y*y) | −2 to 2 |
| waves | sin(x)*cos(y) | −6 to 6, 60 |
| circular ripples | cos(3*sqrt(x*x+y*y))/(1+x*x+y*y) | −4 to 4, 60 |
| sombrero | if(x*x+y*y>0, sin(3*sqrt(x*x+y*y))/(3*sqrt(x*x+y*y)), 1) | −4 to 4, 60 |
| half-sphere | if(x*x+y*y<1, sqrt(1-x*x-y*y), 0) | −1.5 to 1.5, 40 |
| monkey saddle | x^3-3*x*y*y | −1 to 1 |
| two bumps | exp(-x*x-y*y)*cos(2*x)+0.4*exp(-((x-1.2)^2+(y+0.8)^2)) | −2.5 to 2.5, 60 |
The graph is ideal for contour lines and critical points (full version, Render > Overlays…).
Two formulas in x and y: the real part and the imaginary part of w. The height is the modulus |w| (capped), the color the argument (red for positive reals, then the whole hue circle): you see the zeros (the modulus touches 0 and all colors meet there) and the poles (the modulus rises to the cap).
| f(z) | Re w | Im w |
|---|---|---|
| z | x | y |
| z² | x*x-y*y | 2*x*y |
| z³ − 1 (domain −1.5 to 1.5) | x^3-3*x*y*y-1 | 3*x*x*y-y^3 |
| 1/z | x/(x*x+y*y) | -y/(x*x+y*y) |
| exp z | exp(x)*cos(y) | exp(x)*sin(y) |
| sin z | sin(x)*cosh(y) | cos(x)*sinh(y) |
| (z² − 1)/(z² + 1) | see COMPLEXE.ARG |
Advised domain: −2 to 2 in x and in y, 32 to 48 points.
An implicit curve or surface is the set of points where a formula equals zero: x^2+y^2-1 gives the unit circle. The program looks for this zero on a grid: the domain must contain the object, and more points give a finer drawing.
One formula in x and y. Domain: x and y, plus the height of the plane.
| Curve | f(x, y) | domain |
|---|---|---|
| circle | x^2+y^2-1 | −2 to 2, 40 |
| ellipse | x^2/4+y^2-1 | −2.5 to 2.5, 40 |
| lemniscate of Bernoulli | (x*x+y*y)^2-2*(x*x-y*y) | −2 to 2, 60 |
| folium of Descartes | x^3+y^3-3*x*y | −3 to 3, 60 |
| cardioid | (x*x+y*y-x)^2-(x*x+y*y) | −1 to 2.5, 60 |
| heart curve | (x*x+y*y-1)^3-x*x*y^3 | −1.5 to 1.5, 60 |
| periodic pattern | sin(x)*sin(y)-0.2 | −6 to 6, 80 |
One formula in x, y, z; the program draws the curve where the surface f = 0 cuts a plane where one coordinate is constant (axis: x, y or z, and its value). The two domain lines are those of the two other axes.
| Example | f(x, y, z) | slice |
|---|---|---|
| equator of the sphere | x^2+y^2+z^2-1 | z = 0 |
| smaller circle | x^2+y^2+z^2-1 | z = 0.6 |
| hyperbola of a saddle | x*x-y*y-z | z = 0.5 |
| slice of a torus | (x*x+y*y+z*z+3)^2-16*(x*x+y*y) | y = 0 (domain −3.5 to 3.5) |
Two formulas in x, y, z: the curve common to both surfaces. Domain: x, y, z.
| Curve | f | g | domain |
|---|---|---|---|
| equator | x^2+y^2+z^2-1 | z | −1.5 to 1.5, 24 |
| Viviani's curve | x^2+y^2+z^2-4 | (x-1)^2+y^2-1 | −2.2 to 2.2, 32 |
| two cylinders | x*x+z*z-1 | y*y+z*z-1 | −1.5 to 1.5, 32 |
| tilted circle | x^2+y^2+z^2-1 | x+y+z | −1.5 to 1.5, 32 |
One formula in x, y, z: the closed surface where f is zero. Domain: x, y, z. This is the slowest type to compute: start with 20 points per axis, then go up.
| Surface | f(x, y, z) | domain |
|---|---|---|
| sphere | x^2+y^2+z^2-1 | −1.5 to 1.5, 20 |
| ellipsoid | x^2/4+y^2+z^2-1 | x −2.5 to 2.5, y and z −1.5 to 1.5 |
| torus | (x*x+y*y+z*z+3)^2-16*(x*x+y*y) | x, y −3.5 to 3.5; z −1.5 to 1.5; 32 |
| rounded cube | x^4+y^4+z^4-1 | −1.5 to 1.5, 24 |
| gyroid | sin(x)*cos(y)+sin(y)*cos(z)+sin(z)*cos(x) | −3.2 to 3.2, 32 |
| Schwarz P surface | cos(x)+cos(y)+cos(z) | −3.2 to 3.2, 32 |
| one-sheet hyperboloid | x^2+y^2-z^2-0.5 | −1.5 to 1.5, 32 |
| cone | x^2+y^2-z^2 | −1.5 to 1.5, 32 |
| heart | (x*x+9/4*y*y+z*z-1)^3-x*x*z^3-9/80*y*y*z^3 | −1.5 to 1.5, 40 |
★ Several isosurfaces: the same f at several levels, each in its own color (blue → red), for example the spheres x^2+y^2+z^2 at levels 0.25, 1 and 2.25 (document COUPEANI.ARG, or HYPERBOL.ARG for x^2+y^2-z^2 at levels −0.5, 0, 0.5). This setting is made in the document (--iso-levels 0.25,1,2.25 on its line).
File > Open… accepts an STL file (text or binary), as written by CAD and 3D printing software. The object has neither formula nor domain; all render settings apply to it. An object too large for the free memory is refused before being read.
About Blitz Math 3D: the version number (1.0), the variant (68030 with FPU, 68060 with FPU, ColdFire V4e, or light for 68000) and the build date.
| Entry | Effect |
|---|---|
| New | choose a document type and its domain (section 5) |
| Open… | open a .ARG document (or an STL object, full version) |
| Recent files | the last four documents opened or saved |
| Save, Save as… | write the document |
| Export TGA image… | the image, at the size of the window |
| Export OBJ mesh… | the mesh (surfaces, isosurfaces, STL), for a 3D modeler |
| Export VRML scene…, Export POV scene… | a complete scene (object, camera, light, colors) for a VRML viewer or POV-Ray |
| Quit |
| Entry | Effect |
|---|---|
| Undo | back to the document before the last change (16 steps, 4 in the light version) |
| Redo | redoes what was undone |
| Copy | puts the image on the clipboard (SCRAP.TGA and SCRAP.IMG) |
| Entry | Effect |
|---|---|
| Formulas… | the formulas of the document |
| Domain and mesh… | the bounds and number of points, the axis, the starting point |
| ★ Measures… | length, area, volume (closed object), bounding box, number of critical points |
| ★ Variables… | the variables of the document (section 8) |
| ★ Animate a variable… | varies a variable in the window (section 8) |
| Entry | Effect |
|---|---|
| Camera… | orientation and field of view |
| Light… | direction, ambient light, highlights, shading |
| Colors… | colors of the object, background, wireframe, fade, curvature |
| ★ Overlays… | contour lines, critical points, geodesics, Frenet frames, field lines |
| ★ Section… | the section plane |
| Fog… | fog by distance or by altitude |
| Solid | solid faces, on or off |
| Wireframe | the mesh drawn, on or off |
| Entry | Effect |
|---|---|
| Compute | computes the image again |
| Close | closes the document |
| Progress box | shows a box during the computation (otherwise only the mouse pointer) |
| Modal boxes | settings boxes as modal dialogs, even where the AES can put them in windows |
| Solid preview | while turning: solid faces instead of the wireframe (fast machines) |
| Light preview | while turning: fewer lines (slow machines; checked by default in the light version) |
| Error diffusion dither, Ordered dither (Bayer) | in 16 colors or fewer, how shades are rendered |
| Overlay SAGA (PIP), 8-bit palette, Orientation palette | display through the overlay of the Vampire V4SA (full version) |
These window settings last for the session; they are not saved in the document.
Where the AES allows it, the boxes open in windows: you can keep several of them open, change a value and click Apply to see the effect without closing the box.
Yaw (rotation around the vertical axis) and Pitch, in degrees; Field of view (larger: stronger perspective). Initial view goes back to the starting camera. Front view: yaw 0, pitch 0.
Object, Background, Wireframe, and Fade to (a color reached with depth). A color is written:
white, black, red, green, blue, yellow, cyan, magenta, orange;200,170,110;#C8AA6E.With a resource in another language, the color names of that language are accepted too, and the English names always.
★ Color by curvature: the color follows the curvature of the surface (Gaussian by default, or Mean) or of the curve (curvature, or Torsion); scale sets the sensitivity.
What is drawn on top of the object:
The plane a·x + b·y + c·z = d: the side a·x + b·y + c·z ≤ d is kept, the other is removed, which opens the object like a cutaway. Examples:
| a, b, c, d | Effect |
|---|---|
0, 0, 1, 0 | removes everything above z = 0 |
1, 0, 0, 0.5 | keeps x ≤ 0.5 |
0, 1, 0, h | cuts at y = h, where h is a variable (to animate) |
-1, 0, 1.7320508, 0 | a plane tilted by 60° (Villarceau circles of the torus) |
The four numbers may be formulas of the document variables.
★ greyed out in the light version.
Full version.
Object > Variables…: six lines name = value. A variable can be used in all formulas of the document and in the section plane. Leaving a name empty removes the variable.
Example, the pretzel with two parameters (BRETZVAR.ARG): variables R = 4 and r = 1.5, formulas
x(u,v) = (R+r*cos(u)+R*cos(v*0.5)^2)*cos(2*v)
y(u,v) = (R+r*cos(u)+R*cos(v*0.5)^2)*sin(2*v)
z(u,v) = r*sin(u)+R*sin(v)
Change r to 0.5: the tube gets thinner.
Object > Animate a variable…: the variable, its value from, to, and the number of frames. The animation plays in the window; a click or a key stops it, and the document keeps the value of the frame shown. Export asks for a name and also writes each frame as a TGA image, numbered from 000 (ANIM000.TGA, ANIM001.TGA…), to be assembled into a movie with other software.
Animation ideas:
| Document | Variable | from → to |
|---|---|---|
graph a*(x*x-y*y) | a | −1 → 1: the saddle turns over |
isosurface x^2+y^2-z^2-a | a | −0.5 → 0.5: from two sheets to one |
section 0, 1, 0, h on an isosurface | h | −1.6 → 1.6: the plane crosses the object |
polar cos(k*t) | k | 1 → 7: the petals appear |
parametric cos(t), sin(t), p*t | p | 0 → 0.5: the circle stretches into a helix |
A document (.ARG) is a small text file: it holds the type, the formulas, the domain and the render settings. It can be read and edited with a text editor; its line starts with view, followed by the type:
view graph --solid --color orange "x*x-y*y" -2 2 40 -2 2 40 400 300
Edit > Copy (Ctrl+C) writes the image into the system clipboard folder (CLIPBRD) in two forms: SCRAP.TGA (true color) and SCRAP.IMG (256 colors, GEM format). Another program can then paste it.
If the current document has been modified, the program first asks whether to save it.
Full version (MATH3D.PRG, MATH3D60.PRG on a 68060 and MATH3DCF.PRG on the FireBee); under Linux, the math3d program.
Without parameters, MATH3D.PRG is the GEM application described so far. With parameters, it computes an image without a window and writes it to a file: useful to make a series of images, an animation, or a large rendering. Start it from a shell (under MiNT or MagiC), or from a desktop that lets you pass parameters to a program.
The light version (MATH3DL.PRG) has no command line: it only accepts view … (open a document, see below).
MATH3D.PRG <type> [options] <formulas> <domain> <output> [w h]
<type>: the word of the document type (table below);[options]: the render settings, all optional, before the formulas;<formulas>: in double quotes, one per argument;<domain>: the numbers of the domain, line after line (from, to, points);<output>: the file written, .TGA (or .PPM);w h: the width and height of the image, 800 × 600 by default.The program answers Ecrit: <file> (<width>x<height>) ("written"), or an Erreur: … message ("error") that says what is wrong; these messages are in French. MATH3D.PRG --help gives the complete list of types and options.
| Type | Parameters after the options |
|---|---|
explicit | y(x) z(x) · x min max n |
param | x(t) y(t) z(t) · t min max n |
polar | r(t) · t min max n · z plane |
cylindrical | r(t) z(t) · t min max n |
spcurve | r(t) theta(t) phi(t) · t min max n |
rvcurve | r(u) · u min max n · v angle (option --axis x or z) |
surface | x(u,v) y(u,v) z(u,v) · u min max n · v min max n |
spherical | r(theta,phi) · theta min max n · phi min max n |
revolve | r(u) · u min max n · v min max n (option --axis x or z) |
graph | z(x,y) · x min max n · y min max n |
implicit2d | f(x,y) · x min max n · y min max n · z plane |
implicit3d slice | axis (x, y or z) value · f(x,y,z) · two lines min max n |
implicit3d | f(x,y,z) g(x,y,z) · x, y, z min max n |
implicit3d iso | f(x,y,z) · x, y, z min max n |
ode | dx/dt dy/dt dz/dt · t min max n · x0 y0 z0 |
phase | dx/dt dy/dt · x min max n · y min max n · t min max n |
complex | Re w Im w · x min max n · y min max n |
conformal | Re w Im w · x min max n · y min max n |
field | Fx Fy Fz · x, y, z min max n |
stl | STL file |
For implicit3d iso, the word iso comes before the options.
The saddle, solid orange faces, 640 × 480:
MATH3D.PRG graph --solid --no-wire --color orange "x*x-y*y"
-2 2 40 -2 2 40 SADDLE.TGA 640 480
(a single line; it is broken here to fit the page)
The trefoil knot as a tube, colored by its torsion:
MATH3D.PRG param --tube --color-curvature torsion "sin(t)+2*sin(2*t)"
"cos(t)-2*cos(2*t)" "-sin(3*t)" 0 6.283185 400 TREFOIL.TGA
The Lorenz attractor, yellow on a midnight blue background:
MATH3D.PRG ode --color yellow --bg 16,16,28 "10*(y-x)" "x*(28-z)-y"
"x*y-8/3*z" 0 40 4000 1 1 1 LORENZ.TGA
A sphere as an isosurface, with highlights, and its OBJ mesh:
MATH3D.PRG implicit3d iso --solid --no-wire --specular --mesh-output
SPHERE.OBJ "x^2+y^2+z^2-1" -1.5 1.5 24 -1.5 1.5 24 -1.5 1.5 24
SPHERE.TGA
Camera angles are in radians here (the boxes of the application use degrees).
| Option | Effect |
|---|---|
--solid, --no-wire | solid faces; without the wireframe |
--color <c>, --bg <c>, --wire-color <c> | colors of the object, background, wireframe: orange, 200,170,110 or #C8AA6E (English names only) |
--yaw <a>, --pitch <a>, --fov <degrees> | camera: yaw, pitch (defaults 0.6 and 0.5), field of view (45) |
--aa <n> | antialiasing, from 1 to 4 |
--light <x,y,z>, --ambient <a> | light direction, ambient light |
--specular | highlights (--specular-strength, --specular-power) |
--smooth-shading, --analytic-normals | smooth shading; normals computed from the formulas |
--fog, --height-fog | fog by distance, by altitude (--fog-density, --fog-color, --fog-height…) |
--ground-shadow | shadow cast behind the object |
--line-width <n>, --tube | line width; curves as tubes (--tube-radius, --tube-sides) |
--axes, --grid, --title <text> | axes, ground grid, title in the image |
--color-depth, --color-far <c> | fade with depth |
--color-curvature <k> | color by curvature: gauss, mean (surfaces), curvature, torsion (curves) |
--contours <n>, --contour-color <c> | contour lines |
--critical-points | minima, maxima, saddles |
--geodesics <n> | geodesics (--geodesic-from a,b, --geodesic-length L) |
--frenet <k> | Frenet frames |
--section <a,b,c,d> | section: keeps a·x + b·y + c·z ≤ d |
--iso-levels <c1,c2,…> | several isosurfaces (2 to 8) |
--field-lines, --arrow-scale <k> | vector field: field lines, arrow length |
--modulus-cap <c> | cap of the modulus (complex functions, conformal maps) |
--var <name=value> | a formula variable (repeatable) |
--mesh-output <f> | also writes the OBJ mesh |
--vrml-output <f>, --pov-output <f> | also writes the VRML or POV-Ray scene |
--depth-output <f> | also writes the depth map (grey levels) |
--pal8, --orient-pal | 256-color image; palette by face orientation |
--frames <n> computes n frames. What varies:
--yaw-end, --pitch-end, --fov-end (with nothing else, --frames turns the object a full turn);--var a=0 --var-end a=2, the geometry being computed again for each frame;--fog-density-end.The output name must contain %d, replaced by the frame number (%03d: on three digits). For example, the saddle turning over in 24 frames, SAD000.TGA to SAD023.TGA:
MATH3D.PRG graph --solid --no-wire --var a=-1 --var-end a=1 --frames 24
"a*(x*x-y*y)" -2 2 32 -2 2 32 SAD%03d.TGA 320 240
@FILE replaces this word by the content of the file: one or more words per line, # for a comment, quotes around a formula that contains spaces, and other @ inside. It can hold a whole command or only common settings:
MATH3D.PRG graph @STUDIO.OPT "x*x-y*y" -2 2 40 -2 2 40 SADDLE.TGA
The documents of the application are argument files: their line starts with view, followed by the type, the options, the formulas, the domain and the size of the window. MATH3D.PRG @SADDLE.ARG (or just the document name) opens the application with this document. To get an image from it without a window, copy the line without the word view, and add the output name before the size:
the document: view graph --solid "x*x-y*y" -2 2 40 -2 2 40 400 300
the command: MATH3D.PRG graph --solid "x*x-y*y" -2 2 40 -2 2 40
SADDLE.TGA 400 300
A scene describes the same rendering as key: value lines, easier to read than a long command:
mode: graph
solid: true
no-wire: true
render.color: orange
render.contours: 12
expr: exp(-x*x-y*y)*cos(2*x)
x_range: -2.5, 2.5, 60
y_range: -2.5, 2.5, 60
output: CONTOURS.TGA
size: 640, 480
It is run with MATH3D.PRG scene CONTOURS.SCN. Each option becomes render.<option without --> (render.bg, render.yaw, render.fog-density…), variables var: a=1, an animation render.frames and var-end.
The multi type overlays curves, surfaces and implicit objects, with a common camera; each object starts with its word (--curve, --surface, --iso, --implicit2d, --slice, --intersect) and may have its own color:
MATH3D.PRG multi --curve param --color red "cos(t)" "sin(t)" "t/4"
0 12.566371 300 --iso --solid --color cyan "x^2+y^2+z^2-0.25"
-1 1 24 -1 1 24 -1 1 24 MULTI.TGA
Open them with File > Open…; they are documents like yours, to be changed freely. They come twice:
EXAMPLES\: 8.3 names, for TOS (texts in the Atari character set);EX_LONG\: the same, with their original names, for MiNT, MagiC or Linux, which accept long names.Their names are French. ★: full version only.
EXAMPLES\ | EX_LONG\ | What it shows |
|---|---|---|
BRETZEL.ARG | view_bretzel.args | parametric surface (a pretzel), orientation palette |
BRETZVAR.ARG | view_bretzel_variables.args | ★ the same with the variables R and r |
SELLE.ARG | view_selle.args | the saddle, parametric surface |
GRAPHE.ARG | view_graphe.args | graph with if: a half-sphere |
NIVEAUX.ARG | view_niveaux.args | ★ graph and contour lines |
PTSCRIT.ARG | view_points_critiques.args | ★ minima, maxima and saddles of a graph |
FOURIER.ARG | view_fourier.args | ★ graph with sum: product of two Fourier series |
TORECOUR.ARG | view_tore_courbure.args | ★ torus colored by its Gaussian curvature |
SPHECOUR.ARG | view_spherique_courbure.args | ★ spherical surface colored by its mean curvature |
GEODESIQ.ARG | view_geodesiques.args | ★ geodesics on a torus |
VILLARCE.ARG | view_coupe_villarceau.args | ★ torus cut by a bitangent plane |
COUPEANI.ARG | view_coupe_animee.args | ★ three nested spheres, section animatable with h |
HYPERBOL.ARG | view_hyperboloides.args | ★ three isosurfaces: hyperboloids and cone |
FRENET.ARG | view_frenet.args | ★ knot as a tube and its Frenet frames |
NOEUDTOR.ARG | view_noeud_torsion.args | ★ trefoil knot colored by its torsion |
LORENZ.ARG | view_lorenz.args | ★ Lorenz attractor (differential equation) |
PENDULE.ARG | view_pendule.args | ★ phase portrait of the pendulum |
CHAMP.ARG | view_champ.args | ★ Lorenz vector field |
LIGNCHAM.ARG | view_lignes_champ.args | ★ field lines of the pendulum |
COMPLEXE.ARG | view_complexe.args | ★ complex function (z² − 1)/(z² + 1) |
CONFORME.ARG | view_conforme.args | ★ conformal map w = exp z |
The COURBES folder ("curves") holds twenty-one curves, in all coordinate systems, which also open in the light version:
EXAMPLES\COURBES\ | EX_LONG\courbes\ | Curve |
|---|---|---|
C01SINUS.ARG | c01sinus.args | damped sine (explicit) |
C02VAGUE.ARG | c02vague.args | space curve (explicit) |
C03CLOCH.ARG | c03cloch.args | Gaussian bell (explicit) |
C04HELIC.ARG | c04helic.args | helix |
C05TREFL.ARG | c05trefl.args | trefoil knot |
C06VIVIA.ARG | c06vivia.args | Viviani's curve |
C07LISSA.ARG | c07lissa.args | 3D Lissajous |
C08NTORI.ARG | c08ntori.args | torus knot (2, 5) |
C09RESST.ARG | c09resst.args | spring wound on a torus |
C10TENNI.ARG | c10tenni.args | tennis ball seam |
C11ROSE.ARG | c11rose.args | five-petal rose (polar) |
C12CARDI.ARG | c12cardi.args | cardioid (polar) |
C13SPLOG.ARG | c13splog.args | logarithmic spiral (polar) |
C14LEMNI.ARG | c14lemni.args | lemniscate of Bernoulli (polar) |
C15PAPIL.ARG | c15papil.args | Fay's butterfly (polar) |
C16CONE.ARG | c16cone.args | conical spiral (cylindrical) |
C17COURO.ARG | c17couro.args | wavy crown (cylindrical) |
C18RESSV.ARG | c18ressv.args | spring with growing pitch (cylindrical) |
C19LOXOD.ARG | c19loxod.args | loxodrome (spherical) |
C20CLELI.ARG | c20cleli.args | clelia (spherical) |
C21VASE.ARG | c21vase.args | vase profile (meridian) |
The object does not appear, or the window stays empty. Check the domain: for an implicit object, it must contain the object (the sphere of radius 1 needs at least −1 to 1; leave a margin, −1.5 to 1.5). A formula that only gives impossible values (square root of a negative number everywhere) draws nothing.
The formula is refused. The message names the faulty formula (the details of formula errors are in French). Common causes: 2x instead of 2*x, a missing parenthesis, a comma instead of a point (0,5 instead of 0.5), a variable that is not the one of the type (t in a surface in u, v).
The object looks angular. Increase the number of points of the domain (Object > Domain and mesh…) or use Mesh + in the context menu. On a 68000, stay reasonable: the computing time grows like the number of points (curves), its square (surfaces), its cube for an isosurface.
Dragging is slow. Check Window > Light preview. On fast machines, Solid preview on the contrary shows the solid object while turning.
−x² gives a bowl instead of a dome. See the pitfalls of section 4: write -(x^2) or -x*x.
An option is greyed out. In the light version, what needs too much computing without a coprocessor is (fog, highlights, smooth shading); some menus only apply to some types (the section to surfaces and meshes, Frenet frames to curves…).
The light version refuses a document. Its type exists only in the full version (differential equation, complex function, STL…), or it uses sum().
Colors are poor in 16 colors. Try the other dither (Window > Error diffusion dither or Ordered dither); the orientation palette (context menu) often gives the best relief with few colors.