Ken's Equation Graphing

This form submission interfaces with Matlab and allows you to enter parametric equations, IN MATLAB FORMAT, and returns the graph. You will probably want to widen your window a bit to see the whole graph.

Need help or more information? A crash course in Matlab? Some examples? If you have any further questions, you can e-mail me (kam1@cornell.edu).

If you get a warning and an empty pair of 2-D axes, that means something went wrong. The error messages are lifted straight out of Matlab.


Please choose the type of graph


What type of linear graph would you like?

Head to Linear curves section.


What type of surface graph would you like?

Head to parametric surfaces section.


Enter the time variables

The first parametric variable, t, is created below:

(t0) Starting time value:
(tf) Ending time value (must be greater than starting value):
(n) Number of data points (minimum of two):
For parametric surfaces, do NOT use more than 100 data points. If interpolated shading is intended, don't use more than 30!

This creates a 1 row by n columns vector t.

Create the second parametric variable, s, only if needed (parametric surface):

(s0) Starting time value:
(sf) Ending time value (must be greater than starting value):
(m) Number of data points (minimum of two):
For parametric surfaces, do NOT use more than 100 data points. If interpolated shading is intended, don't use more than 30!

This creates a 1 row by m columns vector s.


Enter the one variable parametric equations

Need help on linear graphing?

Parametric surfaces have their own section. Entering in here won't do anything.

To use any of the above numbers in the equations below, refer to them by their variable names listed in parenthesis. Time is, of course, simply t. Pi is spelled like that, and the smallest positive number is eps. i & j both serve as the square root of -1 (unless previously defined otherwise).

The blank text areas are optional; they can be used for such purposes as declaring constants, variables, etc. Whatever's written there will be evaluated as is, and of course any variable declarations can be used later on. Need more room? Just put a commar after an equation and keep going.

Fill in an equation for z only if the graph is 3-dimensional, or is an error bar plot.

Since these equations are evaluated in descending order, any equation can depend on all those that came before it (i.e. y can use x). Also, most of these equations only need y filled in; if x is not given, the indices of y will be used instead for x.



x =
y =
Use y for the radius in a polar plot as well.
z =
use z as the error function in an errorbar plot as well.


Linestyles

Not used in stairs, hist, stem*, errorbar, or rose plots

Line color

Line style

*Line style is used in stem, but not color. Matlab's fault

The next section is for parametric surfaces based on two variables, such as mesh and surface plots. Jump to the end instead.


Enter the two variable parametric equations

Need help on surface graphs?

If you`re entering equations here, remember to have chosen surfaces (2-var) up at the first selection choice

To use any of the above numbers (i.e. t, s, t0, s0, etc.) in the equations below, refer to them by their variable names listed in parenthesis. Time is t, and s if s was specified. Pi is spelled like that, and the smallest positive number is eps. i & j both serve as the square root of -1 (unless previously defined otherwise).

The blank text areas are optional; they can be used for such purposes as declaring constants, variables, etc. Whatever's written there will be evaluated as is, and of course any variable declarations can be used later on. The third blank area is usually used to simplify an equation involving x and y for use in z. Need more room? Just put a commar after an equation and keep going.

x and y can be matrices or vectors, or left out entirely (but one won't be ignored and not the other). If the user prefers, matrices can be generated for them from the vectors they enter for x and y with the use of a meshgrid. If x and y are left out, then in place of them the row and column indices respectively of z are used in their place. If any one of them is left out, both will be ignored.

Instead of entering equations normally, you have the option to take a shortcut and use the hardwired cylinder and sphere functions. If creating a cylinder, enter a radius function vector for z. For sphere, no further equations need be entered. Both cylinder and sphere use n to determine the number of data points around the circumference.

Enter equations normally Create a cylinder Create a sphere


x =
y =
Create a meshgrid out of the above Use above as is

z =
Remember that z must be a matrix, not a vector, unless a cylinder is being created.


Optional Parametric Surfaces Choices

The values of the following graph coloring matrix are scaled and used as indices into the current color map. If left blank, z is used, in which case the color would be proportional to the surface height. Not used in surface with lighting plots.
c =
Remember that c must be a matrix, the same size as z, not a vector.

Colormap:
Gray, copper, bone, or pink are recommended for surface with lighting plots

The final section is only for surface with lighting plots. Once one value is entered into one of the vectors, all of the values within that vector must be given some value or the whole thing will be ignored. K, the contribution vector, will ONLY be used if all of x,y,z, and S are given too.

Specify the direction of the light source: (in spherical coordinates)
S = [ Azimuth , Elevation ]
Azimuth is measured in degrees from the negative y-axis on the x-y plane. Elevation describes the angle in degrees at which you observe the plot above the x-y plane.
If not specified, S defaults to 45 degrees counterclockwise from the current view direction.

Specify the contributions of various light sources:
K = [ ambient light , diffuse reflection , specular reflection , specular spread coefficient ]


Optional Plot Control Functions

Need help on your plot control options?

Shading: WARNING: interp can take a long time with over 30 points or so!
For use with surface, mesh, pseudocolor, fill and fill 3-D plots.
Interpolated is recommended for surface with lighting plots.

Viewpoint specification in spherical coordinates: (optional, only for 3-D)
azimuth , elevation
Azimuth is measured in degrees from the negative y-axis on the x-y plane. Elevation describes the angle in degrees at which you observe the plot above the x-y plane.

Axis limits:
If manual chosen, fill in the following (if only 2-D , the last two text areas can be left blank).
xmin , xmax , ymin , ymax , zmin , zmax
Square is recommended for spheres.

Graph title:

Choose the background color:
Note that on a black background, the black line color will come out white.
Black is recommended for stairs, histogram, stem, error bars, rose, or any plots using yellow line color.


Expect to wait about 5-20 seconds to see the graph, depending on how many data points are being used, the type of graph, and the load on the server.