Gradients Given the function value on vertices,compute the gradient on each triangle. A piecewise linear function f(x)afi+Bfi+yfk X ·Gradient: Xk Vxf (x)=fiVa+fjVxB fkY Because ● l-2 A AT 2AT =(x-)·(xk-x)广/2Ar Gradients • Given the function value on vertices, compute the gradient on each triangle. • A piecewise linear function 𝑓 𝒙 = 𝛼𝑓𝑖 + 𝛽𝑓𝑗 + 𝛾𝑓𝑘 • Gradient: 𝛻𝒙𝑓 𝒙 = 𝑓𝑖𝛻𝒙𝛼 + 𝑓𝑗𝛻𝒙𝛽 + 𝑓𝑘𝛻𝒙𝛾 • Because 𝛼 = 𝐴𝑖 𝐴𝑇 = 𝒙 − 𝒙𝑗 ∙ 𝒙𝑘 − 𝒙𝑗 ⊥ 𝒙𝑘 − 𝒙𝑗 2 𝒙𝑘 − 𝒙𝑗 2 2𝐴𝑇 = 𝒙 − 𝒙𝑗 ∙ 𝒙𝑘 − 𝒙𝑗 ⊥ /2𝐴𝑇 𝑓𝑖 𝑓𝑗 𝑓𝑘 𝒙𝑗 𝒙𝑘 𝒙𝑖 𝒙