Skip to Main Content Skip to Search
Product Documentation

surfnorm - Compute and display 3-D surface normals

Syntax

surfnorm(Z)
surfnorm(X,Y,Z)
[Nx,Ny,Nz] = surfnorm(...)

Description

surfnorm(Z) plots a surface of the matrix Z with surf and displays its surface normals as radiating vectors.

surfnorm(X,Y,Z) plots a surface and its surface normals from the vectors or matrices X, Y, and matrix Z

[Nx,Ny,Nz] = surfnorm(...) returns the components of the 3-D surface normals for the surface without plotting the surface or surface normals.

Tips

Input Arguments

Z

2-D matrix of real numbers representing a surface

X

Vector or matrix of real numbers that defines the x component of the surface

Y

Vector or matrix of real numbers that defines the y component of the surface

Output Arguments

[Nx,Ny,Nz]

x, y, and z components of the three-dimensional surface normals for the surface

Definitions

Surface Normal

An imaginary line perpendicular to a flat surface or perpendicular to the tangent plane at a point on a non-flat surface

Examples

Plot the normal vectors for a truncated cone.

[x,y,z] = cylinder(1:10);
surfnorm(x,y,z)
axis([-12 12 -12 12 -0.1 1])

Algorithms

After performing a bicubic fit of the data in the x, y, and z directions, diagonal vectors are computed and crossed to form the normal at each vertex.

See Also

isonormals | quiver3 | surf | surface | surfl

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS