Surface Curves With Mathematica: Curves On A Sphere
Surface Curves With Mathematica: Curves On A Sphere
This lesson and sample code shows you how to draw a curve that is on a given surface. First, open the following packages: <<Graphics`Shapes` <<Graphics`Animation` <<RealTime3D`
Curves on a Sphere
Draw a sphere: sphere1=ParametricPlot3D[ {Cos[theta]Sin[phi],Sin[theta]Sin[phi],Cos[phi]}, {theta,0,2Pi},{phi,0,Pi},Boxed->False,Axes->False] In this sphere, theta and phi are acting as the two parameters for the surface. To make a curve that lies on this surface, convert each surface parameter to a function of t. Define: theta[t_]=t; phi[t_]=t; spherecurve=ParametricPlot3D[ {Cos[theta[t]]Sin[phi[t]],Sin[theta[t]]Sin[phi[t]],Cos[phi[t]]}, {t,0,1},Boxed->False,Axes->False] Notice that theta is now theta[t] and phi is phi[t] and the domain has changed for t. Type and execute: solidcombo=Show[sphere1,spherecurve] Change theta and phi to theta[t_]=10Pi*t and phi[t_]=Pi*t; and re-execute. Add the option ,PlotPoints->200 inside the plot command for spherecurve and re-execute. Try: SpinShow[spherecurve,Frames->20] and double-click on one of the images. You can stack the images by double-clicking the middle blue bracket on the right side of the window. The animation controls are on the bottom left of the window. Try the following changes: theta(t) = 25B t and phi(t) = 2B t theta(t) = cos(5t) and phi(t) = 4t with 0 # t # 2B Experiment with your own functions. Go back to the ParametricPlot3D command for spherecurve and type 1.1 in front of each of the vector components. This will make the radius of the curve slightly larger than the sphere. Be sure to show both the sphere and your new curve together. - Continued -
Curves on a Cone
To draw a cone, lets set this up so it will be easier to change the surface. x[u_,v_]=u*Cos[v]; y[u_,v_]=u*Sin[v]; z[u_,v_]=u; cone1=ParametricPlot3D[{x[u,v],y[u,v],z[u,v]},{u,-1,1}, {v,0,2Pi},Boxed->False] To create a curve, copy and paste that same code to a new part beneath the cone. Add the following two lines to the top: u[t_]=t; v[t_]=10Pi*t; and delete the x, y, and z functions. Change cone1 to conecurve, make each u and v in the ParametricPlot3D command a function of t by inserting [t] and change to domain for t to go from -1 to 1. Include the option ,PlotPoints->200 in the plot command as well. Try the following for u(t) and v(t): u(t) = cos(4B t) and v(t) = 3B t and make the radius of the curve 1.2, show cone1 and conecurve together.
Create curves on paraboloids and cylinders too. Design your own surfaces and create curves that fit on them.
Copy and paste your favorite images into a new Mathematica file for easier demonstration.
Additional Challenges
Experiment with the different options of SpinShow. Use <<Default3D` and ViewPoint to create alternate views of your curves. Experiment with LightSources (its the only way to color 3D graphs)
Reference: Multivariable CalcLabs with Mathematica for use with James Stewarts Calculus: Early Transcendentals, 4th Edition, by Selwyn Hollis