**tetrahedron_slice_movie**,
a MATLAB code which
displays the intersection of a tetrahedron with a sequence of equally
spaced planes that share a common normal vector.

The intersection of a plane and a tetrahedron is a convex planar polygon which is bounded by 0 to 4 points. The possibilities are:

- 0) empty (no intersection);
- 1) a single point;
- 2) a single line segment;
- 3) a triangle;
- 4) a quadrilateral.

Given a tetrahedron and a normal vector, the program displays a wireframe image of the tetrahedron, and the points of intersection, and the convex intersection polygon, between the tetrahedron and each of a sequence of equally spaced planes that share the normal vector.

The user defines the tetrahedron by giving a 3x4 vertex array **T**
containing the XYZ coordinates of the vertices.

The user defines the planes by specifying a vector **NORMAL**
which defines the direction normal to the planes.

The program includes an internal switch **create_frames** which,
if set to 1, results in each image being stored in a JPG file, so that
a movie file can be created.

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

**tetrahedron_slice_movie** is available in
a MATLAB version.

cavity_flow_movie, a MATLAB code which animates the velocity solutions for the driven cavity;

cvt_1_movie, a MATLAB code which creates an animation of the evolution of a Centroidal Voronoi Tessellation (CVT) in the unit square.

cvt_2_movie, a MATLAB code which animates the generation of a Centroidal Voronoi Tessellation (CVT) in the unit square, which includes a random "rebirth" at every iteration.

cvt_3_movie, a MATLAB code which animates the generation of a Centroidal Voronoi Tessellation (CVT) for the "holey pie" region.

cvt_4_movie, a MATLAB code which creates a Centroidal Voronoi Tessellation (CVT) movie in a square, with a density function that drives points to the corners;

cvt_corn_movie, a MATLAB code which makes a movie in which the growth of a corn kernel is simulated using a Centroidal Voronoi Tessellation (CVT).

gray_scott_movie, a MATLAB code which solves versions of the partial differential equation (PDE) known as the Gray-Scott reaction diffusion equation, converting the solutions to a sequence of graphics frames, which are then assembled into a movie.

peak_movie, a MATLAB code which creates a sequence of frames, and then an animation or movie from the data displayed by the peaks() function.

pendulum_double_ode_movie, a MATLAB code which solves the double pendulum ordinary differential equation (ODE) for a given set of initial conditions and parameters, and makes a movie of the results.

shallow_water_1d_movie, a MATLAB code which solves the partial differential equation (PDE) known as the shallow water equations (SWE), converting the solutions to a sequence of graphics frames, which are then assembled into a movie.

spiral_pde_movie, a MATLAB code which solves a pair of reaction-diffusion partial differential equations (PDE) over a rectangular domain with periodic boundary condition, whose solution is known to evolve into a pair of spirals. The sequence of solutions is bundled into a movie.

tetrahedron_slice_display, a MATLAB code which determines the intersection between a tetrahedron and a plane and displays the result.

- parallelogram_area_3d.m, computes the area of a parallelogram in 3D;
- plane_normal_tetrahedron_intersect.m, finds intersections of a normal plane and a tetrahedron;
- quad_area_3d.m, returns the area of a quadrilateral in 3D;
- r8_sign_opposite_strict.m, is TRUE if two R8's have strictly opposite signs.
- tetrahedron_slice_frame.m, creates a graphics frame depicting the gradually slicing of a tetrahedron by a moving plane.
- tetrahedron_slice_frames.m, repeatedly calls tetrahedron_slice_frame() to create a sequence of graphics frames depicting the gradually slicing of a tetrahedron by a moving plane.
- tetrahedron_slice_movie.m, creates an AVI movie from the sequence of graphics frames built by tetrahedron_slice_frames().