Back to Table of Contents

Creating a Parametrized Curve

        This java program has the ability to create both 2- and 3-dimensional graphs. For example, if we were working in R2 and wanted to draw a circle, we could parametrize it as X(t) = (cos(t), sin(t)), where t is our single parameter. Similarly, if we were working in R3 and wanted to draw a circular helix, we could parametrize it as Y(s) = (cos(s), sin(s), s). Clicking on the "Demo" Button below will bring up three windows: a control panel, a 2D graph, and a 3D graph.


In the control panel we see the parametric equations for the circle X(t) and the circular helix Y(s) as well as the intervals for the parameters s and t. The program approximates a curve by drawing it with straight line segments. The number of steps assigned to the interval indicates how many segments a re used to make the curve. Naturally, the more steps we have the better the approximation will be, but for most intervals no more than 100 steps are needed. In fact, when graphing surfaces, too many steps can cause the program to run slowly.
        To begin, go to the 2D and 3D graph windows and select Tools from the menu on top. This will give you several options on how you can interact with the graph. For example, with the 3D graph, you can Rotate, Translate, Zoom, and Point. Next click on Plot in the menu. This option lets you add your own plot and modify plots that have already been added. Let's modify the helix by changing its color to red. To do this, go to Plot and click on Y(s). This will bring up a window that allows you to decide the curve's color, thickness, and whether or not it is visible. Doubleclick on the color bar labeled Constant Color to change the color of the helix to red. Other ways of modifying curves include changing the intervals of the parameters or just changing the parametric equation itself. For instance, if we wanted to stretch the helix out, we could remove the factor of 1/4 in front of the z-component of Y(s).
        Having learned how to interact with and modify a demonstration of a parametrized curve, we can finally go over how one actually goes about making one. With the demo loaded, go to the control panel window, click on Demo in the menu bar and select the option New Demo. This should leave you with just a blank control panel. To recreate the previous demonstration, start by going to Controls in the menu bar and selecting Add New Interval. Then, in the new window type in your parameter, the lower and upper limits on its interval, and the number of steps. For example, to create the interval for the parameter of a circle you would type "t = -pi, pi, 30" and then press ok. Next, go back to Controls and select Add New Function and type in the parametric equation. For a circle, you would type "X(t) = (cos(t), sin(t))". Note that whenever there is a product in your expression you must always include the multiplication symbol * otherwise the expression will not be interpreted correctly. To graph the curve X(t), go to Controls and select New 2D Graph or New 3D Graph depending on whether your parametric curve is a space curve or a plane curve. The Graph window should initially contain only the axes. To add your parametrized curve, go to Plot: Add Plot: Curve in the graph window. Where it says "Enter parametric curve" simply type in X(t) and press enter. Your curve should appear in the graph window and you can then modify it and interact with it as you want.

Creating a Parametrized Surface

        Clicking on the "Demo" button below will bring up two windows. One window contains the control panel and the other window contains a 3D graph.


Observe in the control that a surface X(u,v) requires the specification of two intervals for each of its parameters u and v. The default surface in this demonstration is a sphere parametrized as X(u,v) = (cos(u)cos(v), sin(u)cos(v), sin(v)). In the 3D window, we see a checkered sphere which we can rotate, zoom, and translate using the Tools option in the menu. To modify the sphere, click on Plot and select X(u,v). There are several options that you can play with in this window. By default, the sphere uses two layers of color: a gray layer and a black and white checker pattern on top. You can change the order in which the colors are placed on the sphere by clicking and dragging the colored boxes. Try dragging the gray box to the top position. This should turn the sphere completely gray. The reasoning behind allowing for multiple layers of color becomes apparent when the Opacity and Blending features are used. Clicking on the gray color box and changing its opacity to some number below 100 reveals the checker pattern underneath. As we lower the opacity of the gray layer, it becomes more and more transparent until it reaches 0 opacity and the color layer becomes completely invisible. The blending option, on the other hand, causes the selected layer to blend with the second layer.
        The method for creating a parametrized surface is essentially the same as for a parametrized curve. Start with a new demo (Demo:New Demo) and then add intervals (Controls: Add New Interval) for each of the two parameters u and v. Try using the intervals u = -pi, pi, 50 and v = -pi, pi, 50. Then, type in the parametric equation for a surface. To create a torus, for instance, you could use the equation X(u,v) = ((2+cos(v))*cos(u), (2+cos(v))*sin(u), sin(v)). Next, create a New 3D Graph and go to Plot: Add Plot: Surface in the surface window. Where it says "Enter a parametric surface" type in X(u,v) and press enter. A green torus should appear. A solid color really isn't the most effective choice for displaying a surface, so you can switch over to a checkered pattern by double-clicking on the green color bar and then changing the coloring type to checkered. The color scheme, position, and size of the surface can then be modified using the previously mentioned features. Other display options which apply mainly to surfaces can be found under Styles in the menu bar of the 3D Graph window.


Next Section