12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

surf, surfcAlgorithmAbstractly, a parametric surface is parametrized by two independentvariables, i and j, which vary continuously over a rectangle; for example,1 ≤ i ≤ m and 1 ≤ j ≤ n. The three functions, x(i,j), y(i,j), and z(i,j),specify the surface. When i and j are integer values, they define a rectangulargrid with integer grid points. The functions x(i,j), y(i,j), and z(i,j)become three m-by-n matrices, X, Y and Z. surface color is a fourth function,c(i,j), denoted by matrix C.Each point in the rectangular grid can be thought of as connected to its fournearest neighbors.i–1,j|i,j–1 – i,j – i,j+1|i+1,jThis underlying rectangular grid induces four-sided patches on the surface. Toexpress this another way, [X(:) Y(:) Z(:)] returns a list of triples specifyingpoints in 3-space. Each interior point is connected to the four neighborsinherited from the matrix indexing. Points on the edge of the surface havethree neighbors; the four points at the corners of the grid have only twoneighbors. This defines a mesh of quadrilaterals or a quad-mesh.Surface color can be specified in two different ways – at the vertices or at thecenters of each patch. In this general setting, the surface need not be asingle-valued function of x and y. Moreover, the four-sided surface patchesneed not be planar. For example, you can have surfaces defined in polar,cylindrical, and spherical coordinate systems.The shading function sets the shading. If the shading is interp, C must be thesame size as X, Y, and Z; it specifies the colors at the vertices. The color withina surface patch is a bilinear function of the local coordinates. If the shading isfaceted (the default) or flat, C(i,j) specifies the constant color in the surfacepatch:(i,j) – (i,j+1)| C(i,j) |(i+1,j) – (i+1,j+1)2-469

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!