Plotting surface from array of points

*To*: MathGroup at yoda.physics.unc.edu*Subject*: Plotting surface from array of points*From*: Robert Villegas <VILLEGAS at knox.bitnet>*Date*: Tue, 19 May 1992 08:19 CDT

Bappaditya Banerjee asked about generating a surface from a list of ordered triples {x, y, z}. In the case you gave, {{1,4,7},{2,5,8},{3,6,9}}, the three points are collinear, so there isn't enough to determine a surface from those alone. If you had three non-collinear points, you could draw the triangle having them as vertices with Polygon: Show[Graphics3D[ Polygon[{p1, p2, p3}] ]] where p1, p2, and p3 are three-element lists of numbers (ordered triples). To situate the object in the usual x, y, and z axes, include the option Axes -> Automatic above. In general, if you have a two-dimensional array of points in xyz-space, you need something different from ListPlot3D. Unlike ListPlot, ListPlot3D does not accept _points_ in space; it takes an array of real numbers indicating the _values_ of a function z = f(x, y) at the lattice points of a rectangle in the xy-plane. That is, ListPlot3D[{ {z11, z12, ..., z1m}, . . . , {zn1, zn2, ..., znm} }] will plot a surface described by the function f whose values are f(1, 1) = z11; f(1, 2) = z12; . . . ; f(1, m) = z1m . . . . . . . . . f(n, 1) = zn1; f(n, 2) = zn2; . . . ; f(n, m) = znm When what you have is an array of points, not values, there is a function called MakePolygons in the package ParametricPlot3D.m from version 1 of Mathematica, and it is also in the first edition of _Programming in Mathematica_ by Roman Maeder. If you don't have the first version of either the program or the book, I could send you a copy of the code in a text file. Or, perhaps it is in the Yoda archive so you could FTP it; I haven't checked. Whichever, I can easily look it up and send it if you need it. Robby Villegas Knox College (Villegas at Knox.Bitnet)