Skip to content

Instantly share code, notes, and snippets.

@tomaslibal
Created November 5, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaslibal/95e4beb0da8af3bd9fad to your computer and use it in GitHub Desktop.
Save tomaslibal/95e4beb0da8af3bd9fad to your computer and use it in GitHub Desktop.
Tangent plane to f(x, y) in GNU Octave
#{
f = x^2 + yx^3 + 2y
tangent plane at (-1, 2, f(x, y)) is:
4x - 6y - z + 19
#}
tx = ty = linspace(-5, 5, 100);
[xx, yy] = meshgrid(tx, ty);
tz = (xx.^2) + (yy*xx.^3) + (2*yy);
meshc(tx, ty, tz);
hold on;
tangz = 4*xx - 6*yy - 19;
meshc(tx, ty, tangz);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment