Dec 312017
Maps functions in three dimensions.
File 3DSURFAC.ZIP from The Programmer’s Corner in
Category Science and Education
Maps functions in three dimensions.
File Name File Size Zip Size Zip Type
3DSUR.COM 55123 30329 deflated
3DSUR.DOC 5868 2337 deflated
TITLE.PIC 16384 5922 deflated

Download File 3DSURFAC.ZIP Here

Contents of the 3DSUR.DOC file

3DSur 3-dimension surface plotting documentation.

3DSur is a program for plotting surfaces of 2 variables z = f(x,y).
There are some already built in functions, you can see the program
plot these functions by changing different parameters or you can
enter your own function. Be careful that the function must by defined
every where on the rectangular region that you want to plot.

Requirements: IBM XT, AT or compatibles
128K RAM and CGA.

You can always back up one level by pressing ESC key at any time
(or almost). When the program ask if you want to print or to save
the program and you answered yes but then you change your mind, you
can always enter "quit" for the file name or press ESC for the print
mode to get out.

There are several mode of plotting a function, here are a brief
description for each of them. (For more details, you have to try out
them yourself).

H,D,N: Hidden line removal, means the part that is not visible will
not be visible on the screen. They are different algorithms.

H: My own algorithm, it plots from far to near and erase in between

D: An algorithm already exits, however I did enhance it by adding the
cross section plotting.

N: The previous algorithms as it is, implemented in Pascal. (see ref)

P: Polar coordinate, use R-Th sections rather than the x-y sections.

F: Fast cartesian coordinate, it is faster than the cartesian method
of plotting, however, you have less control over it, like the
number of points per curve and number of curves per surface, the
program will take the average of these two.

C: Cartesian plotting, it is slower then the previous one, however you
can adjust the number of curves per surfaces in both sections, and
how smooth the curves are.

S: The program will paint the surface, it will simulate the hidden line
one as in 'H'.

None of the hidden line algorithm here is perfect. However, it one
doesn't work, you can try others, later version of this program will
improve this.

While plotting, you can press the upper or lower arrow keys to change
the colors, if your monitors can recognize the different color signals
you should get 15 colors.

scale_factor: is the number of points to calculate to determine the
rescale the image so that it will fit into the display
area. The larger the scale_factor, the accurate is the
scaling, however if you know the graph does not change
radicaly in the interval, you can set a lower scale factor
to speed things up.

Here are some descriptions about the viewing parameters.

rot: angle between the x-axis and the projection of the vector "OP" in
3-D onto the x-y plane, correspond to left-right rotation.
Where OP is the vector joining the origine and the viewing point P.

tilt: angle between the vector OP and the z-axis, correspond to the
up-down rotation of the graph.

rho: distance between the view point P and the origine, where the
origine can be consider as the viewing object also.

dist: distance between the view point P and the projection screen.

ymax: the rectangular area, that is the subset of the domain of the
function that you want to plot the function over.

#Secn: number of curves per surface, the larger the number more dense
the graph is.

Pts/Secns: number of segment used to approximate the curve, the larger
the number, the smooth the curve is.

You can load and save and print a picture, to save and print a picture
you must draw it first. To load a picture, select the load option from
the main menu.

PrintMode (only support Epson printers)

0: 640 points/line (Epson mode 4)
1: 960 points/line (Epson mode 1)
2: 960 points/line (Epson mode 2)
3: 1920 points/line (Epson mode 3)
4: 720 points/line (Epson mode 6)

Words of thanks and references.

Most of the screen layout is from the Merlin program for the IBM PC
together with the polar coordinate plotting method. The person that
wrote these routine is prof P.J Ponzo of University of Waterloo
(Applied Math Department)

The hidden line routine and the cartesian method is from the book
"Microcomputer Graphics for the IBM PC" by Roy E.Myers. This book
is very simple and readable for beginners on graphics.

The screen loading, screen saving, screen printing routines are from
Borland's Graphix Toolbox for Turbo Pascal.

Lastly I want to thank Jimmy Lee who let me use his hardwares for the
development of this program.

If you find this program useful, please consider a contribution in
whatever amount that you feel is appropriate. Any comments, suggestions
are welcome, also if there's any bugs please send them by writing to

Mr. Duy-Minh NHIEU
4882 Mackenzie
Montreal Quebec
Canada H3W-1B3

Sourse code in Turbo Pascal available for a charge of $50 U.S.
You are encouraged to copy and distribute 3DSur and its related files
and charge no fee of any kind.
Freely freely you have received, freely freely give!

 December 31, 2017  Add comments

Leave a Reply