Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Manipulate[Module[{x, y},
- ContourPlot[Exp[-x^2 - y^2] + x y, {x, -1, 1}, {y, -1, 1},
- Contours -> 20,
- Epilog ->
- Dynamic[{Arrow[{pt,
- pt + {y - 2 E^(-x^2 - y^2) x, x - 2 E^(-x^2 - y^2) y} /. {x ->
- pt[[1]], y -> pt[[2]]}}]}]
- ]],
- {{pt, {.5, .5}}, Locator,
- Appearance -> Graphics[{Red, Disk[]}, ImageSize -> 5]}]
- Clear[x, y, f];
- f = E^(-x^2 - y^2) + x y;
- Grad[f, {x, y}];
- Manipulate[Module[{x, y},
- ContourPlot[f, {x, -1, 1}, {y, -1, 1},
- Contours -> 20,
- Epilog ->
- Dynamic[{Arrow[{pt,
- pt + Grad[f, {x, y}] /. {x -> pt[[1]], y -> pt[[2]]}}]}]
- ]],
- {{pt, {.5, .5}}, Locator,
- Appearance -> Graphics[{Red, Disk[]}, ImageSize -> 5]}]
- Manipulate[
- ContourPlot[f, {x, -1, 1}, {y, -1, 1},
- Contours -> 20,
- Epilog ->
- Dynamic[{Arrow[{pt,
- pt + Grad[f, {x, y}] /. {x -> pt[[1]], y -> pt[[2]]}}]}]
- ],
- {{pt, {.5, .5}}, Locator,
- Appearance -> Graphics[{Red, Disk[]}, ImageSize -> 5]}]
- x=12
- Clear[x, y, f];
- f = E^(-x^2 - y^2) + x y;
- Grad[f, {x, y}];
- DynamicModule[{x, y},
- Manipulate[
- ContourPlot[f, {x, -1, 1}, {y, -1, 1},
- Contours -> 20,
- Epilog ->
- Dynamic[{Arrow[{pt,
- pt + Grad[f, {x, y}] /. {x -> pt[[1]], y -> pt[[2]]}}]}]
- ],
- {{pt, {.5, .5}}, Locator,
- Appearance -> Graphics[{Red, Disk[]}, ImageSize -> 5]}]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement