Plots > 3D Plots > Example: Plotting a Vector-Valued Function
Example: Plotting a Vector-Valued Function
Create a 3D mesh plot by defining a vector-valued function and compare the result with a plot that uses the CreateMesh function.
Plotting a Vector-Valued Function
Plot a vector-valued function to define a parametric surface in 3D space.
1. Define a vector-valued function of two parameters.
In this function, u+v represents the x-coordinates, v2 represents the y-coordinates, and u*v represents the z-coordinates.
2. Press Ctrl+3, type the name of the function in the placeholder of the z-axis expression, and change the Trace Color and the Surface Fill.
PTC Mathcad plots a vector-valued function as a mesh.
Plotting a Function Using CreateMesh
1. Define the range of the two above parameters so that they contain only positive values.
 umin 0 umax 10 nu 10 vmin 0 vmax 10 nv 10
2. Use CreateMesh to get a data set from the function g and the u and v ranges.
3. Press Ctrl+3 and plot M.
The range of the M plot differs from the range of the g plot due to the difference in the input variables. M is plotted according to the ranges defined in step 1, while g is plotted according to the default range (-10, 10).
4. To set the range of g, define a range variable for u and v above the plot.
 u2nd umin
umax umin nu 1
u umin u2nd umax v2nd vmin
vmax vmin nv 1
v vmin v2nd vmax
5. Plot g again.
When you plot a vector-valued function, you must define range variables above the plot to set the range.
Comparing the Two Plots
1. Define new values for the min and max of the ranges.
 umin -100 umax -55 vmin 45 vmax 75
2. Define the number of intervals and recalculate M.
3. Recalculate the ranges of u and v.
 u2nd umin
umax umin nu 1
u umin u2nd umax v2nd vmin
vmax vmin nv 1
v vmin v2nd vmax
4. Plot M and g.
The two plots look exactly the same because identical nodes are plotted in both cases.