mGrad: Interactive applet for exploring gradients

Description Usage Arguments Details Value Author(s) Examples

Description

Displays the level plot, contour plot, and gradient field of a given two-dimensional function.

Usage

1
mGrad(expr, ..., xlim = c(0,10), ylim = c(0,10))

Arguments

expr

A mathematical formula of two variables of the form f(x,y)~x&y)

...

Extra arguments to be passed with expr as part of the mathematical function. Generally these are not evaluated.

xlim

The limits of the x axis.

ylim

The limits of the y axis.

Details

The gradient checkbox turns the gradient arrows on and off. Show partial w.r.t x and y checkboxes display the x and y components of the gradient vectors. Scale gradient units allows the arrows to be on a reasonable scale; at 1 they are their full width. Arrow spacing controls the number of gradient arrows on the screen, the smaller the spacing the more arrows there will be on the plot. Color palette merely allows the user to pick between 5 color schemes for the levelplot. Approximate number of contour lines is a slider that controls the number of contour lines through the pretty algorithm such that they are evenly spaced at nice intervals. Background smoothness chooses the width of the square grid upon which the calculations are performed. At large values the program runs slower, but has higher resolution.

Value

A function that implements and displays the level plot, contour plot, and gradient field of a given two-dimensional function.

Author(s)

Andrew Rich (andrew.joseph.rich@gmail.com) and Daniel Kaplan (kaplan@macalester.edu)

Examples

1
2
3
4
5
6
	if(require(manipulate)){
		mGrad(x*y~x&y)
		mGrad(sin(x*y)~x&y)
		mGrad(sin(cos(x)+y)~x&y)
		mGrad(cos(x)*sin(y)*y~x&y)
	}

mosaicManip documentation built on May 2, 2019, 5:48 p.m.