<diagram dimensions="(300,300)" margins="5">
<definition>f(x,y) = x^3+y^3-6*x*y</definition>
<!-- point of tangency -->
<definition>x0 = 3</definition>
<definition>y0 = 4</definition>
<definition>p0 = (x0, y0)</definition>
<!-- gradient of f, and a direction perpendicular to it -->
<definition>grad_f(x,y) = grad(f, (x,y))</definition>
<definition>g = grad_f(x0, y0)</definition>
<definition>dir = (-g[1], g[0])</definition>
<definition>p1 = p0 + dir</definition>
<coordinates bbox="[-5,-5,5,5]">
<grid-axes />
<implicit-curve function="f" k="f(x0,y0)" stroke="blue" />
<line endpoints="(p0,p1)" infinite="yes" stroke="red"/>
<point p="p0" size="6" fill="red"/>
</coordinates>
</diagram>