<p>A function <span class="math-container">$f$</span> on your triangulated surface is an assignment of real numbers on the vertices of the triangulation and therefore <span class="math-container">$f \in \mathbb{R}^{|\mathcal{V}|}$</span>. According to the continuous theory, the gradient should be a linear (differential) operator that takes a function and spits out a vector field. Hence, in the discrete theory, the gradient should be a linear operator that takes a function <span class="math-container">$f \in \mathbb{R}^{|\mathcal{V}|}$</span> and spit out some kind of a discrete version of a vector field. In your case, the vector field is given as an assignment of a vector to each triangle of the triangulation. That is why the discrete gradient operator should be a linear operator, i.e. a linear transformation
<span class="math-container">$$\text{grad} : \mathbb{R}^{\mathcal{|V|}} \to \mathbb{R}^{3|\mathcal{F}|}$$</span><br>
which is represented by a matrix <span class="math-container">$\text{grad} \in \mathbb{R}^{3|\mathcal{F}| \times |\mathcal{V}|}$</span>. In the continuous theory, the gradient is determined only by local data, i.e. the behaviou of the function near the point at which the gradient is being calculated and by the geometry near that point. Therefore, in the discrete theory, the gradient is determined only by the geometry of one triangle and the values of the function at the triangle's vertices. Let the triangle <span class="math-container">$j \in  \mathcal{F}$</span> have vertices denoted (according to the instructions' convention) by <span class="math-container">$1, 2, 3$</span>. The labels are set up so that the vertices <span class="math-container">$1,2,3$</span> define the labels of the opposing edges <span class="math-container">$\vec{e}_{j_1}, \vec{e}_{j_2}, \vec{e}_{j_3}$</span>, i.e. for the vertex  <span class="math-container">$i$</span> the edge opposite to the vertex <span class="math-container">$i$</span> is denoted by <span class="math-container">$\vec{e}_{j_i}$</span>, where the latter vector is oriented so that the vectors form a closed chain of vectors summing to zero in a counterclockwise direction.<br>
Hence, the gradient can be defined as
<span class="math-container">$$(\text{grad}\,f)(j) = \frac{1}{2\text{Area}(j)}\, \sum_{i=1}^{3} f_i\, J\vec{e}_{j_i}$$</span> Or to write it in coordinates, 
<span class="math-container">$$\begin{bmatrix} (\text{grad}\,f)(j)_1\\ (\text{grad}\,f)(j)_2\\(\text{grad}\,f)(j)_3\end{bmatrix} = \frac{1}{2\text{Area}(j)}\left( f_1\, \begin{bmatrix} (Je_{j_1})_1\\ (Je_{j_1})_2\\(Je_{j_1})_3\end{bmatrix} + 
f_2\, \begin{bmatrix} (Je_{j_2})_1\\ (Je_{j_2})_2\\(Je_{j_2})_3\end{bmatrix} + f_3\, \begin{bmatrix} (Je_{j_3})_1\\ (Je_{j_3})_2\\(Je_{j_3})_3\end{bmatrix}\right)$$</span> and in matrix form
<span class="math-container">$$\begin{bmatrix} (\text{grad}\,f)(j)_1\\ (\text{grad}\,f)(j)_2\\(\text{grad}\,f)(j)_3\end{bmatrix} = \frac{1}{2\text{Area}(j)}\, \begin{bmatrix} (Je_{j_1})_1 &amp;  (Je_{j_2})_1 &amp; (Je_{j_3})_1 \\ (Je_{j_1})_2 &amp; (Je_{j_2})_2 &amp; (Je_{j_3})_2\\(Je_{j_1})_3 &amp; (Je_{j_2})_3 &amp; (Je_{j_3})_3 \end{bmatrix} \begin{bmatrix} f_1\\ f_2\\f_3\end{bmatrix} $$</span>
So, for the matrix <span class="math-container">$E \in \mathbb{R}^{3|\mathcal{F}|\times|\mathcal{V}|}$</span> is defined as follows. Let <span class="math-container">$j$</span> be a triangle and <span class="math-container">$i$</span> one of its vertices. Take the edge <span class="math-container">$e_{j_i}$</span> of triangle <span class="math-container">$j$</span> opposite to the vertex <span class="math-container">$i$</span>, and consider the vector <span class="math-container">$\vec{e}_{j_i}$</span> along the edge, starting from one vertex, different from <span class="math-container">$i$</span>, to the other vertex, different from <span class="math-container">$i$</span>, oriented so that the the vector follows counterclockwise orientation of the boundary of the triangle <span class="math-container">$j$</span>. Then rotate the vector <span class="math-container">$\vec{e}_{j_i}$</span> by <span class="math-container">$90^{\circ}$</span> so that it points inside the triangle <span class="math-container">$j$</span>. Denote this rotated vector by  <span class="math-container">$$J\vec{e}_{j_i} = \begin{bmatrix} (Je_{j_i})_1\\ (Je_{j_i})_2\\(Je_{j_i})_3\end{bmatrix}$$</span> Then fill up the following entries of the matrix <span class="math-container">$E \in \mathbb{R}^{3|\mathcal{F}|\times|\mathcal{V}|}$</span>:<br>
<span class="math-container">\begin{align}
&amp;E(j,i) = (Je_{j_i})_1\\
&amp;E(j + |\mathcal{F}|, i) = (Je_{j_i})_2\\
&amp;E(j + 2|\mathcal{F}|, i) = (Je_{j_i})_3
\end{align}</span><br>
You can rotate the vector <span class="math-container">$\vec{e}_{j_i}$</span> by using the cross-product operation twice. Take two of the edge-vectors of the triangle <span class="math-container">$j$</span>, say <span class="math-container">$\vec{e}_{j_1}$</span> and <span class="math-container">$\vec{e}_{j_2}$</span>, and calculate the unit normal vector to the triangle <span class="math-container">$j$</span>:
<span class="math-container">$$\vec{n}_j = \frac{1}{\|\vec{e}_{j_1} \times \vec{e}_{j_2}\|}\,\Big(\vec{e}_{j_1} \times \vec{e}_{j_2}\Big)$$</span> It doesn't matter whcih two out of the three edge-vector you would choose, the result is always the same unit normal <span class="math-container">$\vec{n}_j$</span>. Then
<span class="math-container">$$J\vec{e}_{j_i} = \vec{n}_j \times \vec{e}_{j_i}$$</span></p>

CC BY-SA 4.0
2019-05-16T07:13:08.170Z
Thank you very much for the time you took to write this explanation.
Mark.F
CC BY-SA 4.0
2019-05-13T03:07:30.967Z
2019-05-13T22:43:40.147Z
2019-05-13T22:43:40.147Z
Futurologist
<p>In a homework we were tasked to calculate the gradient of a triangle respective to a corner vertex. The instructions didn't say what to calculate and mentioned, one could derive it by a derivative of the triangle area using the corner vertex coordinates. I exactly came to the same formula explained by Futurologist.</p>
<p>In case someone wants to know, this is the derivation:</p>
<p>Let <span class="math-container">$\vec{x},\vec{y}, \vec{z} \in \mathcal{V}$</span> be the vertex corners of the triangle.</p>
<p>First, the area of a triangle is the length of the cross product between two sides of it divided by 2 (because the determinant calculates the area of a parallelogram which is twice the area of the triangle):
<span class="math-container">$A(\vec{x}) = \left|(\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right|/2 = \sqrt{\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)^2}/2$</span></p>
<p>The multiplication of vectors should be the dot product whose meaning depends on the operands left and right to it. Using differential calculus rules for vectors, this is what I get:</p>
<p><span class="math-container">$\frac{\partial A}{\partial \vec{x}} = \frac{\frac{\partial \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)^2}{\partial \vec{x}}}{4\sqrt{\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)^2}}$</span>
<span class="math-container">$= \frac{\frac{\partial \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)}{\partial \vec{x}} \cdot 2\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{4A}$</span></p>
<p>How to calculate the gradient of a cross product? If we would look for the divergence, we would use the determinant <span class="math-container">$\text{det}(\nabla_\vec{x},\vec{y}-\vec{x},\vec{z}-\vec{x})$</span> but that's not the gradient. The gradient <span class="math-container">$\partial A/\partial \vec{c}$</span> must be a vector itself so that <span class="math-container">$\partial(\vec{a}\times\vec{b})/\partial \vec{b}$</span> must be a matrix!
Now, just think of <span class="math-container">$M \times \vec{b}$</span> like a matrix product but using <span class="math-container">$M_i \times \vec{b}$</span> to replace the dot product <span class="math-container">$M_i \cdot \vec{b}$</span> of a normal matrix multiplication (each result component will now be a row vector, not a scalar).</p>
<p>Next step is to split those cross products up into a sum:</p>
<p><span class="math-container">$\frac{\partial A}{\partial \vec{x}}= \frac{\frac{\partial \left(\vec{y}\times\vec{z}-\vec{x}\times\vec{z} - \vec{y}\times\vec{x} + \vec{x}\times\vec{x}\right)}{\partial \vec{x}} \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$</span></p>
<p><span class="math-container">$\vec{y}\times\vec{z}$</span> does not depend on <span class="math-container">$\vec{x}$</span>, <span class="math-container">$\vec{x}\times\vec{x}$</span> is <span class="math-container">$\vec{0}$</span>. It now is used that <span class="math-container">$\partial(\vec{a}\times\vec{b})/\partial \vec{a} = I\times\vec{b}$</span>, where <span class="math-container">$I$</span> is the eye matrix. It is a fact that <span class="math-container">$Y_\times = I\times\vec{y}$</span> is the (left) cross product matrix from <span class="math-container">$\vec{y}$</span> so that <span class="math-container">$\left(I \times \vec{z}\right)^T = \left(I\times(-\vec{z})\right)$</span> is the right cross product matrix from <span class="math-container">$\vec{z}$</span>. Hence</p>
<p><span class="math-container">$\frac{\partial A}{\partial \vec{x}}= \frac{\frac{\partial \left(\vec{x}\times\vec{y}-\vec{x}\times\vec{z}\right)}{\partial \vec{x}} \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$</span>
<span class="math-container">$= \frac{\left(I\times\vec{y}-I\times\vec{z}\right) \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$</span>
<span class="math-container">$= \frac{\left(I\times(\vec{y}-\vec{z})\right) \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$</span>
<span class="math-container">$= \frac{\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)\times(\vec{z}-\vec{y}) }{2A}$</span></p>
<p>So this result is exactly the same as <span class="math-container">$-\frac{\mathcal{J}\vec{e_{j_i}}}{2} = \frac{(-\vec{n})\times\vec{e_{j_i}}}{2}$</span> where <span class="math-container">$\vec{e_{j_i}} = \vec{z}-\vec{y}$</span>, <span class="math-container">$i = \vec{x}$</span> and the direction will always show towards the opposite edge of <span class="math-container">$\vec{x}$</span> indepent of which vertex is chosen to be <span class="math-container">$\vec{y}$</span> and which is <span class="math-container">$\vec{z}$</span>. That's the reason, why the <span class="math-container">$2$</span> in the original formula for <span class="math-container">$(\text{grad} f)(j)$</span> is needed, to divide away the factor of <span class="math-container">$2$</span> within the <span class="math-container">$\vec{e_{j_i}}$</span>.</p>
<p>If you work with parallelograms instead of triangles you can remove the <span class="math-container">$2$</span> entirely.</p>
<p>What does the gradient of a triangle mean after all? The triangle gradient is the direction, where -- if you move <span class="math-container">$\vec{x}$</span> in that direction -- the triangle experiences the biggest change in area. You can add together the gradient of multiple triangles from <span class="math-container">$\vec{x}$</span> to use it for minimizing surface area of a discrete 3D surface.</p>

CC BY-SA 4.0
2021-02-19T19:29:20.717Z
2021-02-20T00:38:32.060Z
2021-02-20T00:38:32.060Z
ChrisoLosoph
<p>This question is regarding a homework assignment (want to be upfront because many people on stack exchange don't like helping with homework questions).</p>

<p>I have a triangular mesh, which is defined by a set of vertices and a set of faces.
I want to calculate the discrete gradient of the mesh, and I even got instructions on how to implement it. The problem is that even after reading them multiple times, I don't understand them...</p>

<p><strong>The implementation instructions:</strong></p>

<p><a href="https://i.sstatic.net/MTZ2w.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MTZ2w.png" alt="enter image description here"></a></p>

<p><strong>My Problem:</strong></p>

<p>I don't understand how to implement the marked sum, which in turn prevents me from constructing the following E matrix.</p>

<p>I would appreciate any help. I'm not looking for specific code examples, rather an explanation/example of the calculation for a single triangle. </p>

CC BY-SA 4.0
2024-06-15T00:25:23.720Z
Do you have a reference for the image in your question?
MerelyLearning
<computational-geometry><matlab>
Calculating the gradient of a triangular mesh
Mark.F
# Calculating the gradient of a triangular mesh

(Asked by: username_0 on 2019-05-11)

This question is regarding a homework assignment (want to be upfront because many people on stack exchange don't like helping with homework questions).

I have a triangular mesh, which is defined by a set of vertices and a set of faces.
I want to calculate the discrete gradient of the mesh, and I even got instructions on how to implement it. The problem is that even after reading them multiple times, I don't understand them...

**The implementation instructions:**

[![enter image description here](https://i.sstatic.net/MTZ2w.png)](https://i.sstatic.net/MTZ2w.png)

**My Problem:**

I don't understand how to implement the marked sum, which in turn prevents me from constructing the following E matrix.

I would appreciate any help. I'm not looking for specific code examples, rather an explanation/example of the calculation for a single triangle.

**Tags:** computational-geometry, matlab

> **Comments:**
> **username_1**: Do you have a reference for the image in your question?  

---

## 2 answers

### Answer by username_2 on 2019-05-13. Score: 3 | Accepted answer

A function $f$ on your triangulated surface is an assignment of real numbers on the vertices of the triangulation and therefore $f \in \mathbb{R}^{|\mathcal{V}|}$. According to the continuous theory, the gradient should be a linear (differential) operator that takes a function and spits out a vector field. Hence, in the discrete theory, the gradient should be a linear operator that takes a function $f \in \mathbb{R}^{|\mathcal{V}|}$ and spit out some kind of a discrete version of a vector field. In your case, the vector field is given as an assignment of a vector to each triangle of the triangulation. That is why the discrete gradient operator should be a linear operator, i.e. a linear transformation
$$\text{grad} : \mathbb{R}^{\mathcal{|V|}} \to \mathbb{R}^{3|\mathcal{F}|}$$  
which is represented by a matrix $\text{grad} \in \mathbb{R}^{3|\mathcal{F}| \times |\mathcal{V}|}$. In the continuous theory, the gradient is determined only by local data, i.e. the behaviou of the function near the point at which the gradient is being calculated and by the geometry near that point. Therefore, in the discrete theory, the gradient is determined only by the geometry of one triangle and the values of the function at the triangle's vertices. Let the triangle $j \in \mathcal{F}$ have vertices denoted (according to the instructions' convention) by $1, 2, 3$. The labels are set up so that the vertices $1,2,3$ define the labels of the opposing edges $\vec{e}\_{j\_1}, \vec{e}\_{j\_2}, \vec{e}\_{j\_3}$, i.e. for the vertex $i$ the edge opposite to the vertex $i$ is denoted by $\vec{e}\_{j\_i}$, where the latter vector is oriented so that the vectors form a closed chain of vectors summing to zero in a counterclockwise direction.  
Hence, the gradient can be defined as
$$(\text{grad}\,f)(j) = \frac{1}{2\text{Area}(j)}\, \sum\_{i=1}^{3} f\_i\, J\vec{e}\_{j\_i}$$ Or to write it in coordinates,
$$\begin{bmatrix} (\text{grad}\,f)(j)\_1\\ (\text{grad}\,f)(j)\_2\\(\text{grad}\,f)(j)\_3\end{bmatrix} = \frac{1}{2\text{Area}(j)}\left( f\_1\, \begin{bmatrix} (Je\_{j\_1})\_1\\ (Je\_{j\_1})\_2\\(Je\_{j\_1})\_3\end{bmatrix} +
f\_2\, \begin{bmatrix} (Je\_{j\_2})\_1\\ (Je\_{j\_2})\_2\\(Je\_{j\_2})\_3\end{bmatrix} + f\_3\, \begin{bmatrix} (Je\_{j\_3})\_1\\ (Je\_{j\_3})\_2\\(Je\_{j\_3})\_3\end{bmatrix}\right)$$ and in matrix form
$$\begin{bmatrix} (\text{grad}\,f)(j)\_1\\ (\text{grad}\,f)(j)\_2\\(\text{grad}\,f)(j)\_3\end{bmatrix} = \frac{1}{2\text{Area}(j)}\, \begin{bmatrix} (Je\_{j\_1})\_1 & (Je\_{j\_2})\_1 & (Je\_{j\_3})\_1 \\ (Je\_{j\_1})\_2 & (Je\_{j\_2})\_2 & (Je\_{j\_3})\_2\\(Je\_{j\_1})\_3 & (Je\_{j\_2})\_3 & (Je\_{j\_3})\_3 \end{bmatrix} \begin{bmatrix} f\_1\\ f\_2\\f\_3\end{bmatrix} $$
So, for the matrix $E \in \mathbb{R}^{3|\mathcal{F}|\times|\mathcal{V}|}$ is defined as follows. Let $j$ be a triangle and $i$ one of its vertices. Take the edge $e\_{j\_i}$ of triangle $j$ opposite to the vertex $i$, and consider the vector $\vec{e}\_{j\_i}$ along the edge, starting from one vertex, different from $i$, to the other vertex, different from $i$, oriented so that the the vector follows counterclockwise orientation of the boundary of the triangle $j$. Then rotate the vector $\vec{e}\_{j\_i}$ by $90^{\circ}$ so that it points inside the triangle $j$. Denote this rotated vector by $$J\vec{e}\_{j\_i} = \begin{bmatrix} (Je\_{j\_i})\_1\\ (Je\_{j\_i})\_2\\(Je\_{j\_i})\_3\end{bmatrix}$$ Then fill up the following entries of the matrix $E \in \mathbb{R}^{3|\mathcal{F}|\times|\mathcal{V}|}$:  
\begin{align}
&E(j,i) = (Je\_{j\_i})\_1\\
&E(j + |\mathcal{F}|, i) = (Je\_{j\_i})\_2\\
&E(j + 2|\mathcal{F}|, i) = (Je\_{j\_i})\_3
\end{align}  
You can rotate the vector $\vec{e}\_{j\_i}$ by using the cross-product operation twice. Take two of the edge-vectors of the triangle $j$, say $\vec{e}\_{j\_1}$ and $\vec{e}\_{j\_2}$, and calculate the unit normal vector to the triangle $j$:
$$\vec{n}\_j = \frac{1}{\|\vec{e}\_{j\_1} \times \vec{e}\_{j\_2}\|}\,\Big(\vec{e}\_{j\_1} \times \vec{e}\_{j\_2}\Big)$$ It doesn't matter whcih two out of the three edge-vector you would choose, the result is always the same unit normal $\vec{n}\_j$. Then
$$J\vec{e}\_{j\_i} = \vec{n}\_j \times \vec{e}\_{j\_i}$$

> **Comments:**
> **username_0**: Thank you very much for the time you took to write this explanation.  

---

### Answer by username_3 on 2021-02-19. Score: 0

In a homework we were tasked to calculate the gradient of a triangle respective to a corner vertex. The instructions didn't say what to calculate and mentioned, one could derive it by a derivative of the triangle area using the corner vertex coordinates. I exactly came to the same formula explained by username_2.

In case someone wants to know, this is the derivation:

Let $\vec{x},\vec{y}, \vec{z} \in \mathcal{V}$ be the vertex corners of the triangle.

First, the area of a triangle is the length of the cross product between two sides of it divided by 2 (because the determinant calculates the area of a parallelogram which is twice the area of the triangle):
$A(\vec{x}) = \left|(\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right|/2 = \sqrt{\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)^2}/2$

The multiplication of vectors should be the dot product whose meaning depends on the operands left and right to it. Using differential calculus rules for vectors, this is what I get:

$\frac{\partial A}{\partial \vec{x}} = \frac{\frac{\partial \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)^2}{\partial \vec{x}}}{4\sqrt{\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)^2}}$
$= \frac{\frac{\partial \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)}{\partial \vec{x}} \cdot 2\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{4A}$

How to calculate the gradient of a cross product? If we would look for the divergence, we would use the determinant $\text{det}(\nabla\_\vec{x},\vec{y}-\vec{x},\vec{z}-\vec{x})$ but that's not the gradient. The gradient $\partial A/\partial \vec{c}$ must be a vector itself so that $\partial(\vec{a}\times\vec{b})/\partial \vec{b}$ must be a matrix!
Now, just think of $M \times \vec{b}$ like a matrix product but using $M\_i \times \vec{b}$ to replace the dot product $M\_i \cdot \vec{b}$ of a normal matrix multiplication (each result component will now be a row vector, not a scalar).

Next step is to split those cross products up into a sum:

$\frac{\partial A}{\partial \vec{x}}= \frac{\frac{\partial \left(\vec{y}\times\vec{z}-\vec{x}\times\vec{z} - \vec{y}\times\vec{x} + \vec{x}\times\vec{x}\right)}{\partial \vec{x}} \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$

$\vec{y}\times\vec{z}$ does not depend on $\vec{x}$, $\vec{x}\times\vec{x}$ is $\vec{0}$. It now is used that $\partial(\vec{a}\times\vec{b})/\partial \vec{a} = I\times\vec{b}$, where $I$ is the eye matrix. It is a fact that $Y\_\times = I\times\vec{y}$ is the (left) cross product matrix from $\vec{y}$ so that $\left(I \times \vec{z}\right)^T = \left(I\times(-\vec{z})\right)$ is the right cross product matrix from $\vec{z}$. Hence

$\frac{\partial A}{\partial \vec{x}}= \frac{\frac{\partial \left(\vec{x}\times\vec{y}-\vec{x}\times\vec{z}\right)}{\partial \vec{x}} \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$
$= \frac{\left(I\times\vec{y}-I\times\vec{z}\right) \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$
$= \frac{\left(I\times(\vec{y}-\vec{z})\right) \cdot \left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right) }{2A}$
$= \frac{\left((\vec{y}-\vec{x})\times(\vec{z}-\vec{x})\right)\times(\vec{z}-\vec{y}) }{2A}$

So this result is exactly the same as $-\frac{\mathcal{J}\vec{e\_{j\_i}}}{2} = \frac{(-\vec{n})\times\vec{e\_{j\_i}}}{2}$ where $\vec{e\_{j\_i}} = \vec{z}-\vec{y}$, $i = \vec{x}$ and the direction will always show towards the opposite edge of $\vec{x}$ indepent of which vertex is chosen to be $\vec{y}$ and which is $\vec{z}$. That's the reason, why the $2$ in the original formula for $(\text{grad} f)(j)$ is needed, to divide away the factor of $2$ within the $\vec{e\_{j\_i}}$.

If you work with parallelograms instead of triangles you can remove the $2$ entirely.

What does the gradient of a triangle mean after all? The triangle gradient is the direction, where -- if you move $\vec{x}$ in that direction -- the triangle experiences the biggest change in area. You can add together the gradient of multiple triangles from $\vec{x}$ to use it for minimizing surface area of a discrete 3D surface.


---

