<p>Here's a simple proof that the inverse transpose is required. Suppose we have a plane, defined by a plane equation $n \cdot x + d = 0$, where $n$ is the normal. Now I want to transform this plane by some matrix $M$. In other words, I want to find a new plane equation $n' \cdot Mx + d' = 0$ that is satisfied for exactly the same $x$ values that satisfy the previous plane equation.</p>

<p>To do this, it suffices to set the two plane equations equal. (This gives up the ability to rescale the plane equations arbitrarily, but that's not important to the argument.) Then we can set $d' = d$ and subtract it out. What we have left is:</p>

<p>$$n' \cdot Mx = n \cdot x$$</p>

<p>I'll rewrite this with the dot products expressed in matrix notation (thinking of the vectors as 1-column matrices):</p>

<p>$${n'}^T Mx = n^T x$$</p>

<p>Now to satisfy this for <em>all</em> $x$, we must have:</p>

<p>$${n'}^T M = n^T$$</p>

<p>Now solving for $n'$ in terms of $n$,</p>

<p>$$\begin{aligned}{n'}^T &amp;= n^T M^{-1} \\
n' &amp;= (n^T M^{-1})^T\\
n' &amp;= (M^{-1})^T n\end{aligned}$$</p>

<p>Presto! If points $x$ are transformed by a matrix $M$, then plane normals must transform by the inverse transpose of $M$ in order to preserve the plane equation.</p>

<p>This is basically a property of the dot product. In order for the dot product to remain invariant when a transformation is applied, the two vectors being dotted have to transform in corresponding but different ways.</p>

<p>Mathematically, this can be described by saying that the normal vector isn't an ordinary vector, but a thing called a <a href="https://en.wikipedia.org/wiki/Linear_form" rel="noreferrer">covector</a> (aka covariant vector, dual vector, or linear form). A covector is basically defined as "a thing that can be dotted with a vector to produce an invariant scalar". In order to achieve that, it has to transform using the inverse transpose of whatever matrix is operating on ordinary vectors. This holds in any number of dimensions.</p>

<p>Note that in 3D specifically, a bivector is similar to a covector. They're not <em>quite</em> the same since they have different units: a covector has units of inverse length while a bivector has units of length squared (area), so they behave differently under scaling. However, they do transform the same way with respect to their orientation, which is what matters for normals. We usually don't care about the magnitude of a normal (we always normalize them to unit length anyway), so we usually don't need to worry about the difference between a bivector and a covector.</p>

CC BY-SA 3.0
2015-09-16T01:24:32.717Z
awesome explanation. however a bit fast on 2 points, a bit more details would be loved : 1. how do you jump from dot products to matrix products ? 2. between line 2 and 3 of last quoted section, what happens (n is moved from left to right a bit magically to me)
v.oddou
CC BY-SA 3.0
2015-09-16T01:30:29.597Z
1. (a^T)b is the same as dot(a, b) if a and b are column matrices of the same dimension. Try out the math for yourself!
2. (AB)^T = (B^T)(A^T), and (A^T)^T = A
For more matrix identities, check out [The Matrix Cookbook](http://www.math.uwaterloo.ca/~hwolkowi/matrixcookbook.pdf)
Mokosha
CC BY-SA 3.0
2015-09-16T05:42:33.543Z
@v.oddou Yep, Mokosha is right. Dot product can be expressed as multiplying a 1×n matrix (row vector) with a n​×1 matrix (column vector); the result is a 1×1 matrix whose single component is the dot product. The transpose of a column vector is a row vector, so we can write a·b as a^T b. For the second question, transposing a product of matrices is equivalent to transposing the individual factors and reversing their order.
Nathan Reed
CC BY-SA 3.0
2015-09-16T06:09:21.337Z
perfect, its all clear without issue now. thanks both.
v.oddou
CC BY-SA 3.0
2015-09-16T08:32:11.153Z
@NathanReed (Gosh this takes me back to the early PowerVR days where we modelled most things with planes). It might also be worth mentioning that, for optimisation purposes, if you have a matrix _Mr_ that only contain rotations, (i.e. is orthogonal) then Inverse(_Mr_) = Transpose(_Mr_), and so Trans(Inverse(_Mr_)=_Mr_.   You can also take shortcuts with the translation part and if you know the scaling is uniform. FWIW in the SGL PowerVR graphics library, we used to keep booleans to track whether a transformation matrix had these properties to save costs with the normal transformations.
Simon F
CC BY-SA 3.0
2017-04-20T16:43:23.850Z
Great answer; thank you. I had never come across the distinction between bi- and covectors, but it clarifies things for me. Bivectors obviously have a direct geometric algebra representation; do you know if covectors also do?
Paul Du Bois
CC BY-SA 3.0
2017-04-20T20:46:23.197Z
@PaulDuBois I think covectors are what geometric algebra terms a dual vector. In 3D GA, the dual of a vector is a bivector; it doesn't make the distinction in the algebra. But they still transform differently: one should use the outermorphism for bivectors, and the dual transform for dual vectors. (And again, in 3D I think those come out the same, up to a scale factor.)
Nathan Reed
CC BY-SA 3.0
2015-09-15T23:32:23.543Z
2015-11-03T19:14:57.103Z
2015-11-03T19:14:57.103Z
Nathan Reed
<p>This is simply because normals are not really vectors! They are created by cross products, which results in <a href="https://en.wikipedia.org/wiki/Bivector" rel="noreferrer">bivectors</a>, not vectors. Algebra works much different for these coordinates, and geometric transformation is just one operation that behaves differently.</p>

<p>A great resource for learning more about this is <a href="http://www.terathon.com/gdc12_lengyel.pdf" rel="noreferrer">Eric Lengyel's presentation on Grassman Algebra</a>.</p>

CC BY-SA 3.0
2017-10-04T17:03:53.123Z
Normals are also so-called pseudovectors. As a generalization and rule of thumb, everything resulting from a cross product (e.g. planes) will be transformed in a similar fashion.
Matthias
CC BY-SA 3.0
2015-09-15T21:15:36.447Z
2015-09-15T21:15:36.447Z
ap_
<p>When rendering 3D scenes with transformations applied to the objects, normals have to be transformed with the transposed inverse of the model view matrix. So, with a normal $n$, modelViewMatrix $M$, the transformed normal $n'$ is </p>

<p>$$n' = (M^{-1})^{T} \cdot n $$</p>

<p>When transforming the objects, it is clear that the normals need to be transformed accordingly. But why, mathematically, is this the corresponding transformation matrix?</p>

CC BY-SA 3.0
2017-10-01T23:52:53.853Z
If the model matrix is made of translation, rotation and scale, you don't need to do inverse transpose to calculate normal matrix. Simply divide the normal by squared scale and multiply by model matrix and we are done. You can extend that to any matrix with perpendicular axes, just calculate squared scale for each axes of the matrix you are using instead. I wrote the details in my blog: https://lxjk.github.io/2017/10/01/Stop-Using-Normal-Matrix.html
Eric
<transformations><geometry>
Why is the transposed inverse of the model view matrix used to transform the normal vectors?
Nero
# Why is the transposed inverse of the model view matrix used to transform the normal vectors?

(Asked by: username_0 on 2015-09-15)

When rendering 3D scenes with transformations applied to the objects, normals have to be transformed with the transposed inverse of the model view matrix. So, with a normal $n$, modelViewMatrix $M$, the transformed normal $n'$ is

$$n' = (M^{-1})^{T} \cdot n $$

When transforming the objects, it is clear that the normals need to be transformed accordingly. But why, mathematically, is this the corresponding transformation matrix?

**Tags:** transformations, geometry

> **Comments:**
> **username_1**: If the model matrix is made of translation, rotation and scale, you don't need to do inverse transpose to calculate normal matrix. Simply divide the normal by squared scale and multiply by model matrix and we are done. You can extend that to any matrix with perpendicular axes, just calculate squared scale for each axes of the matrix you are using instead. I wrote the details in my blog: https://lxjk.github.io/2017/10/01/Stop-Using-Normal-Matrix.html  

---

## 2 answers

### Answer by username_2 on 2015-09-15. Score: 34 | Accepted answer

Here's a simple proof that the inverse transpose is required. Suppose we have a plane, defined by a plane equation $n \cdot x + d = 0$, where $n$ is the normal. Now I want to transform this plane by some matrix $M$. In other words, I want to find a new plane equation $n' \cdot Mx + d' = 0$ that is satisfied for exactly the same $x$ values that satisfy the previous plane equation.

To do this, it suffices to set the two plane equations equal. (This gives up the ability to rescale the plane equations arbitrarily, but that's not important to the argument.) Then we can set $d' = d$ and subtract it out. What we have left is:

$$n' \cdot Mx = n \cdot x$$

I'll rewrite this with the dot products expressed in matrix notation (thinking of the vectors as 1-column matrices):

$${n'}^T Mx = n^T x$$

Now to satisfy this for *all* $x$, we must have:

$${n'}^T M = n^T$$

Now solving for $n'$ in terms of $n$,

$$\begin{aligned}{n'}^T &= n^T M^{-1} \\
n' &= (n^T M^{-1})^T\\
n' &= (M^{-1})^T n\end{aligned}$$

Presto! If points $x$ are transformed by a matrix $M$, then plane normals must transform by the inverse transpose of $M$ in order to preserve the plane equation.

This is basically a property of the dot product. In order for the dot product to remain invariant when a transformation is applied, the two vectors being dotted have to transform in corresponding but different ways.

Mathematically, this can be described by saying that the normal vector isn't an ordinary vector, but a thing called a [covector](https://en.wikipedia.org/wiki/Linear_form) (aka covariant vector, dual vector, or linear form). A covector is basically defined as "a thing that can be dotted with a vector to produce an invariant scalar". In order to achieve that, it has to transform using the inverse transpose of whatever matrix is operating on ordinary vectors. This holds in any number of dimensions.

Note that in 3D specifically, a bivector is similar to a covector. They're not *quite* the same since they have different units: a covector has units of inverse length while a bivector has units of length squared (area), so they behave differently under scaling. However, they do transform the same way with respect to their orientation, which is what matters for normals. We usually don't care about the magnitude of a normal (we always normalize them to unit length anyway), so we usually don't need to worry about the difference between a bivector and a covector.

> **Comments:**
> **username_3**: awesome explanation. however a bit fast on 2 points, a bit more details would be loved : 1. how do you jump from dot products to matrix products ? 2. between line 2 and 3 of last quoted section, what happens (n is moved from left to right a bit magically to me)  
> **username_4**: 1. (a^T)b is the same as dot(a, b) if a and b are column matrices of the same dimension. Try out the math for yourself! 2. (AB)^T = (B^T)(A^T), and (A^T)^T = A For more matrix identities, check out [The Matrix Cookbook](http://www.math.uwaterloo.ca/~hwolkowi/matrixcookbook.pdf)  
> **username_2**: @username_3 Yep, username_4 is right. Dot product can be expressed as multiplying a 1×n matrix (row vector) with a n​×1 matrix (column vector); the result is a 1×1 matrix whose single component is the dot product. The transpose of a column vector is a row vector, so we can write a·b as a^T b. For the second question, transposing a product of matrices is equivalent to transposing the individual factors and reversing their order.  
> **username_3**: perfect, its all clear without issue now. thanks both.  
> **username_5**: @username_2 (Gosh this takes me back to the early PowerVR days where we modelled most things with planes). It might also be worth mentioning that, for optimisation purposes, if you have a matrix _Mr_ that only contain rotations, (i.e. is orthogonal) then Inverse(_Mr_) = Transpose(_Mr_), and so Trans(Inverse(_Mr_)=_Mr_.   You can also take shortcuts with the translation part and if you know the scaling is uniform. FWIW in the SGL PowerVR graphics library, we used to keep booleans to track whether a transformation matrix had these properties to save costs with the normal transformations.  
> **username_6**: Great answer; thank you. I had never come across the distinction between bi- and covectors, but it clarifies things for me. Bivectors obviously have a direct geometric algebra representation; do you know if covectors also do?  
> **username_2**: @username_6 I think covectors are what geometric algebra terms a dual vector. In 3D GA, the dual of a vector is a bivector; it doesn't make the distinction in the algebra. But they still transform differently: one should use the outermorphism for bivectors, and the dual transform for dual vectors. (And again, in 3D I think those come out the same, up to a scale factor.)  

---

### Answer by username_7 on 2015-09-15. Score: 11

This is simply because normals are not really vectors! They are created by cross products, which results in [bivectors](https://en.wikipedia.org/wiki/Bivector), not vectors. Algebra works much different for these coordinates, and geometric transformation is just one operation that behaves differently.

A great resource for learning more about this is [username_1 Lengyel's presentation on Grassman Algebra](http://www.terathon.com/gdc12_lengyel.pdf).

> **Comments:**
> **username_8**: Normals are also so-called pseudovectors. As a generalization and rule of thumb, everything resulting from a cross product (e.g. planes) will be transformed in a similar fashion.  

---

