This program is not finished. It is the product of some simple vector geometry that I refreshed for a Mathematics course at university.
Furthermore, the program is currently completely undocumented albeit somewhat commented. It has no user interface of any kind either, so you will need to edit the source to modify its output. (Not too hard if you ever touched Perl sources.)
Let me explain in a little more detail what this program does:
Given three component functions of one or two parameters t, u
x(t,u), y(t,u), and z(t,u), it constructs
the three dimensional vector function s(t,u). Not too hard, but how can
you display three dimensional functions on a computer screen?
threedp solves this problem by projecting a number of calculated
vectors p=s(t,u) onto an arbitrary plane. Like your screen.
Mathematically, the program calculates the intersection of the plane
given by D + a*E + b*F and the line s(t,u) + c*N where N is orthogonal
to E and F. The intersection can be found by solving a linear equation
system (3 equations x 3 unknown values).
It is trivial to implement s(N) with N being a matrix of higher order than 2. Unfortunately, drawing complexity rises exponentially with more dimensions, so that it is not a smart move to sacrifice performance in all cases when this feature is only useful in very rare occasions. Modify the code as needed.
I am lazy; code reuse is good and, to be honest, the most efficient
and robust algorithms for solving linear equation systems are beyond me.
Hence I am using the handily powerful module Math::MatrixReal
by Steffen Beyer et al (See
search.cpan.org).
You will need to install GD and Math::MatrixReal on your
system as well as Perl 5.6.0 or higher. (Tested with 5.6.1)
Downloads (currently only the newest version availlable):
(c) 2002 Steffen Müller; All rights reserved.