Parametric Plotting Tutorial

Parametric Plotting Tutorial

A live version of this calculation is available at EngineeringPaper.xyz.

The parametric plotting capabilities of EngineeringPaper.xyz allow you to plot curves that don’t represent a strict functional relationship between the y and x values. The syntax for parametric plot of a circle is (sin(s),cos(s)) for (0<=s<=2*pi)= where the first ordered pair contains the expressions that define the x and y values as a function of the independent variable s. The range at the end of the expression indicates the range that should be used for the independent variable s. Note that the parenthesis around the first ordered pair and the range are required and that the equals sign at the end of the expression is also required. See this expression used in the following example plot:

Note that the “1:1 Ratio” option has been selected in the plot above in order to ensure that size of the divisions of the y-axis match the size of the divisions of the x-axis. This option prevents the circle from looking like an ellipse. In the above example, the expressions to be plotted are placed directly into the expression defining the parametric plot. However, we may alternatively define the functions to be plotted outside of the plot cell as in the following example:

$$ x_{spiral}=s\cdot\sin\left(s\right),:y_{spiral}=s\cdot\cos\left(s\right) $$

When functions are used to define the x and y axis expressions, the function names are used to label and x and y axes as can be seen in the above plot. By default, a parametric plot uses 100 equally spaced points from the range specified for the independent variable. In the above example, 100 points leads to a noticeably jagged result. To smooth out the result, we can specify the number of points to use as in the following example:

Like all expressions and plots in EngineeringPaper.xyz, any units that you specify will be checked and used for the plot axes scaling and labels. See the following example:

Similar to scatter plots, the units for the axis scales can be specified by placing a pair of compatible dimensions after the equals sign as in the following example:

The final example shows that EngineeringPaper.xyz makes it easy to combine function plots, scatter plots, and parametric plots into a single plot:

where the functions and vectors used in the above plot are defined below:

$$ x_{parametric}=\sin\left(3\cdot t\right)\cdot\cos\left(t\right),:y_{parametric}=\sin\left(3\cdot t\right)\cdot\sin\left(t\right) $$

$$ y_{function}=-x^2 $$

$$ x_{scatter}=\begin{bmatrix}0\ \cos\left(30\left\lbrack deg\right\rbrack\right)\ -\cos\left(30\left\lbrack deg\right\rbrack\right)\ 0\end{bmatrix},:y_{scatter}=\begin{bmatrix}-1\ \sin\left(30\left\lbrack deg\right\rbrack\right)\ \sin\left(30\left\lbrack deg\right\rbrack\right)\ -1\end{bmatrix} $$