In geometry, a normal is an object such as a line, ray, or vector that is perpendicular to a given object. For example, in two dimensions, the normal line to a curve at a given point is the line perpendicular to the tangent line to the curve at the point.
A normal vector may have length one (a unit vector) or its length may represent the curvature of the object (a curvature vector); its algebraic sign may indicate sides (interior or exterior).
In three dimensions, a surface normal, or simply normal, to a surface at point ''P'' is a vector perpendicular to the tangent plane of the surface at P. The word "normal" is also used as an adjective: a line ''normal'' to a plane, the ''normal'' component of a force, the normal vector, etc. The concept of normality generalizes to orthogonality (right angles).
The concept has been generalized to differentiable manifolds of arbitrary dimension embedded in a Euclidean space. The normal vector space or normal space of a manifold at point ''P'' is the set of vectors which are orthogonal to the tangent space at ''P''.
Normal vectors are of special interest in the case of smooth curves and smooth surfaces.
The normal is often used in 3D computer graphics (notice the singular, as only one normal will be defined) to determine a surface's orientation toward a light source for flat shading, or the orientation of each of the surface's corners (vertices) to mimic a curved surface with Phong shading.

Normal to surfaces in 3D space

Calculating a surface normal

For a convex polygon (such as a triangle), a surface normal can be calculated as the vector cross product of two (non-parallel) edges of the polygon. For a plane given by the equation $ax\; +\; by\; +\; cz\; +\; d\; =\; 0$, the vector $\backslash mathbf\; n\; =\; (a,\; b,\; c)$ is a normal. For a plane whose equation is given in parametric form :$\backslash mathbf(s,t)\; =\; \backslash mathbf\_0\; +\; s\; \backslash mathbf\; +\; t\; \backslash mathbf$, where r_{0} is a point on the plane and p, q are non-parallel vectors pointing along the plane, a normal to the plane is a vector normal to both p and q, which can be found as the cross product $\backslash mathbf=\backslash mathbf\backslash times\backslash mathbf$.
If a (possibly non-flat) surface ''S'' in 3-space R^{3} is parameterized by a system of curvilinear coordinates r(''s'', ''t'') = (''x''(''s'',''t''), ''y''(''s'',''t''), ''z''(''s'',''t'')), with ''s'' and ''t'' real variables, then a normal to ''S'' is by definition a normal to a tangent plane, given by the cross product of the partial derivatives
:$\backslash mathbf=\backslash frac\; \backslash times\; \backslash frac.$
If a surface ''S'' is given implicitly as the set of points $(x,\; y,\; z)$ satisfying $F(x,\; y,\; z)=0$, then a normal at a point $(x,\; y,\; z)$ on the surface is given by the gradient
:$\backslash mathbf=\backslash nabla\; F(x,\; y,\; z).$
since the gradient at any point is perpendicular to the level set ''S''.
For a surface ''S'' in R^{3} given as the graph of a function $z=f(x,\; y)$, an upward-pointing normal can be found either from the parametrization $\backslash mathbf(x,y)=(x,y,f(x,y))$, giving
:$\backslash mathbf\; =\; \backslash frac\; \backslash times\; \backslash frac\; =\; \backslash left(1,0,\backslash tfrac\backslash right)\; \backslash times\; \backslash left(0,1,\backslash tfrac\backslash right)\; =\; \backslash left(-\backslash tfrac,\; -\backslash tfrac,1\backslash right);$
or more simply from its implicit form $F(x,\; y,\; z)\; =\; z-f(x,y)\; =\; 0$, giving $\backslash mathbf\; =\; \backslash nabla\; F(x,\; y,\; z)\; =\; \backslash left(-\backslash tfrac,\; -\backslash tfrac,\; 1\; \backslash right)$.
Since a surface does not have a tangent plane at a singular point, it has no well-defined normal at that point: for example, the vertex of a cone. In general, it is possible to define a normal almost everywhere for a surface that is Lipschitz continuous.

Choice of normal

The normal to a (hyper)surface is usually scaled to have unit length, but it does not have a unique direction, since its opposite is also a unit normal. For a surface which is the topological boundary of a set in three dimensions, one can distinguish between the inward-pointing normal and outer-pointing normal. For an oriented surface, the normal is usually determined by the right-hand rule or its analog in higher dimensions. If the normal is constructed as the cross product of tangent vectors (as described in the text above), it is a pseudovector.

Transforming normals

:''Note: in this section we only use the upper 3×3 matrix, as translation is irrelevant to the calculation'' When applying a transform to a surface it is often useful to derive normals for the resulting surface from the original normals. Specifically, given a 3×3 transformation matrix M, we can determine the matrix W that transforms a vector n perpendicular to the tangent plane t into a vector n′ perpendicular to the transformed tangent plane M t, by the following logic: Write n′ as W n. We must find W. $W\backslash mathbb\; n\; \backslash text\; M\backslash mathbb\; t$ :$\backslash iff(W\; \backslash mathbb\; n)\; \backslash cdot\; (M\; \backslash mathbb\; t)\; =\; 0$ :$\backslash iff\; (W\; \backslash mathbb\; n)^\backslash mathrm\; (M\; \backslash mathbb\; t)\; =\; 0$ :$\backslash iff\; (\backslash mathbb\; n^\backslash mathrm\; W^\backslash mathrm)\; (M\; \backslash mathbb\; t)\; =\; 0$ :$\backslash iff\; \backslash mathbb\; n^\backslash mathrm\; (W^\backslash mathrm\; M)\; \backslash mathbb\; t\; =\; 0$ Clearly choosing W such that $W^\backslash mathrm\; M\; =\; I$, or $W\; =\; (M^)^\backslash mathrm$, will satisfy the above equation, giving a $W\; \backslash mathbb\; n$ perpendicular to $M\; \backslash mathbb\; t$, or an n′ perpendicular to t′, as required. Therefore, one should use the inverse transpose of the linear transformation when transforming surface normals. The inverse transpose is equal to the original matrix if the matrix is orthonormal, i.e. purely rotational with no scaling or shearing.

Hypersurfaces in ''n''-dimensional space

For an $(n-1)$-dimensional hyperplane in ''n''-dimensional space R^{n} given by its parametric representation
:$\backslash mathbf(t\_1,\backslash ldots,t\_)\; =\; \backslash mathbf\_0\; +\; t\_1\; \backslash mathbf\_1\; +\; \backslash cdots\; +\; t\_\backslash mathbf\_\; ,$
where p_{0} is a point on the hyperplane and p_{''i''} for are linearly independent vectors pointing along the hyperplane, a normal to the hyperplane is any vector $\backslash mathbf\; n$ in the null space of the matrix $P\; =\; \backslash begin\backslash mathbf\_1\; \&\; \backslash cdots\; \&\backslash mathbf\_\backslash end$, meaning $P\backslash mathbf\; n\; =\; \backslash mathbf\; 0$. That is, any vector orthogonal to all in-plane vectors is by definition a surface normal. Alternatively, if the hyperplane is defined as the solution set of a single linear equation $a\_1x\_1+\backslash cdots+a\_nx\_n\; =\; c$, then the vector $\backslash mathbb\; =\; (a\_1,\backslash ldots,a\_n)$ is a normal.
The definition of a normal to a surface in three-dimensional space can be extended to (''n''−1)-dimensional hypersurfaces in R^{n}. A hypersurface may be locally defined implicitly as the set of points $(x\_1,\; x\_2,\; \backslash ldots,\; x\_n)$ satisfying an equation $F(x\_1,\; x\_2,\; \backslash ldots,\; x\_n)\; =\; 0$, where $F$ is a given scalar function. If $F$ is continuously differentiable then the hypersurface is a differentiable manifold in the neighbourhood of the points where the gradient is not zero. At these points a normal vector is given by the gradient:
:$\backslash mathbb\; n\; =\backslash nabla\; F(x\_1,\; x\_2,\; \backslash ldots,\; x\_n)\; =\; \backslash left(\; \backslash tfrac,\; \backslash tfrac,\; \backslash ldots,\; \backslash tfrac\; \backslash right)\backslash ,.$
The normal line is the one-dimensional subspace with basis .

Varieties defined by implicit equations in ''n''-dimensional space

A differential variety defined by implicit equations in the ''n''-dimensional space R^{n} is the set of the common zeros of a finite set of differentiable functions in ''n'' variables
:$f\_1(x\_1,\backslash ldots,x\_n),\; \backslash ldots,\; f\_k(x\_1,\backslash ldots,x\_n).$
The Jacobian matrix of the variety is the ''k''×''n'' matrix whose ''i''-th row is the gradient of ''f''_{''i''}. By the implicit function theorem, the variety is a manifold in the neighborhood of a point where the Jacobian matrix has rank ''k''. At such a point ''P'', the normal vector space is the vector space generated by the values at ''P'' of the gradient vectors of the ''f''_{''i''}.
In other words, a variety is defined as the intersection of ''k'' hypersurfaces, and the normal vector space at a point is the vector space generated by the normal vectors of the hypersurfaces at the point.
The normal (affine) space at a point ''P'' of the variety is the affine subspace passing through ''P'' and generated by the normal vector space at ''P''.
These definitions may be extended ''verbatim'' to the points where the variety is not a manifold.

Example

Let ''V'' be the variety defined in the 3-dimensional space by the equations :$x\backslash ,y=0,\; \backslash quad\; z=0\backslash ,.$ This variety is the union of the ''x''-axis and the ''y''-axis. At a point , where , the rows of the Jacobian matrix are and . Thus the normal affine space is the plane of equation . Similarly, if , the normal plane at is the plane of equation . At the point the rows of the Jacobian matrix are and . Thus the normal vector space and the normal affine space have dimension 1 and the normal affine space is the ''z''-axis.

Uses

*Surface normals are useful in defining surface integrals of vector fields. *Surface normals are commonly used in 3D computer graphics for lighting calculations (see Lambert's cosine law), often adjusted by normal mapping. *Render layers containing surface normal information may be used in Digital compositing to change the apparent lighting of rendered elements. *In computer vision, the shapes of 3D objects are estimated from surface normals using photometric stereo.

Normal in geometric optics

frame|Diagram of specular reflection The normal ray is the outward-pointing ray perpendicular to the surface of an optical medium at a given point. In reflection of light, the angle of incidence and the angle of reflection are respectively the angle between the normal and the incident ray (on the plane of incidence) and the angle between the normal and the reflected ray.

See also

* Ellipsoid normal vector * Pseudovector * Dual space * Vertex normal

References

External links

* {{MathWorld|title=Normal Vector|urlname=NormalVector * A

explanation of normal vectors

from Microsoft's MSDN * Clear pseudocode fo

calculating a surface normal

from either a triangle or polygon. Category:Surfaces Category:Vector calculus Category:3D computer graphics

Normal to surfaces in 3D space

Calculating a surface normal

For a convex polygon (such as a triangle), a surface normal can be calculated as the vector cross product of two (non-parallel) edges of the polygon. For a plane given by the equation $ax\; +\; by\; +\; cz\; +\; d\; =\; 0$, the vector $\backslash mathbf\; n\; =\; (a,\; b,\; c)$ is a normal. For a plane whose equation is given in parametric form :$\backslash mathbf(s,t)\; =\; \backslash mathbf\_0\; +\; s\; \backslash mathbf\; +\; t\; \backslash mathbf$, where r

Choice of normal

The normal to a (hyper)surface is usually scaled to have unit length, but it does not have a unique direction, since its opposite is also a unit normal. For a surface which is the topological boundary of a set in three dimensions, one can distinguish between the inward-pointing normal and outer-pointing normal. For an oriented surface, the normal is usually determined by the right-hand rule or its analog in higher dimensions. If the normal is constructed as the cross product of tangent vectors (as described in the text above), it is a pseudovector.

Transforming normals

:''Note: in this section we only use the upper 3×3 matrix, as translation is irrelevant to the calculation'' When applying a transform to a surface it is often useful to derive normals for the resulting surface from the original normals. Specifically, given a 3×3 transformation matrix M, we can determine the matrix W that transforms a vector n perpendicular to the tangent plane t into a vector n′ perpendicular to the transformed tangent plane M t, by the following logic: Write n′ as W n. We must find W. $W\backslash mathbb\; n\; \backslash text\; M\backslash mathbb\; t$ :$\backslash iff(W\; \backslash mathbb\; n)\; \backslash cdot\; (M\; \backslash mathbb\; t)\; =\; 0$ :$\backslash iff\; (W\; \backslash mathbb\; n)^\backslash mathrm\; (M\; \backslash mathbb\; t)\; =\; 0$ :$\backslash iff\; (\backslash mathbb\; n^\backslash mathrm\; W^\backslash mathrm)\; (M\; \backslash mathbb\; t)\; =\; 0$ :$\backslash iff\; \backslash mathbb\; n^\backslash mathrm\; (W^\backslash mathrm\; M)\; \backslash mathbb\; t\; =\; 0$ Clearly choosing W such that $W^\backslash mathrm\; M\; =\; I$, or $W\; =\; (M^)^\backslash mathrm$, will satisfy the above equation, giving a $W\; \backslash mathbb\; n$ perpendicular to $M\; \backslash mathbb\; t$, or an n′ perpendicular to t′, as required. Therefore, one should use the inverse transpose of the linear transformation when transforming surface normals. The inverse transpose is equal to the original matrix if the matrix is orthonormal, i.e. purely rotational with no scaling or shearing.

Hypersurfaces in ''n''-dimensional space

For an $(n-1)$-dimensional hyperplane in ''n''-dimensional space R

Varieties defined by implicit equations in ''n''-dimensional space

A differential variety defined by implicit equations in the ''n''-dimensional space R

Example

Let ''V'' be the variety defined in the 3-dimensional space by the equations :$x\backslash ,y=0,\; \backslash quad\; z=0\backslash ,.$ This variety is the union of the ''x''-axis and the ''y''-axis. At a point , where , the rows of the Jacobian matrix are and . Thus the normal affine space is the plane of equation . Similarly, if , the normal plane at is the plane of equation . At the point the rows of the Jacobian matrix are and . Thus the normal vector space and the normal affine space have dimension 1 and the normal affine space is the ''z''-axis.

Uses

*Surface normals are useful in defining surface integrals of vector fields. *Surface normals are commonly used in 3D computer graphics for lighting calculations (see Lambert's cosine law), often adjusted by normal mapping. *Render layers containing surface normal information may be used in Digital compositing to change the apparent lighting of rendered elements. *In computer vision, the shapes of 3D objects are estimated from surface normals using photometric stereo.

Normal in geometric optics

frame|Diagram of specular reflection The normal ray is the outward-pointing ray perpendicular to the surface of an optical medium at a given point. In reflection of light, the angle of incidence and the angle of reflection are respectively the angle between the normal and the incident ray (on the plane of incidence) and the angle between the normal and the reflected ray.

See also

* Ellipsoid normal vector * Pseudovector * Dual space * Vertex normal

References

External links

* {{MathWorld|title=Normal Vector|urlname=NormalVector * A

explanation of normal vectors

from Microsoft's MSDN * Clear pseudocode fo

calculating a surface normal

from either a triangle or polygon. Category:Surfaces Category:Vector calculus Category:3D computer graphics