Vector Functions#


Revised

06 Apr 2023


Programming Environment#

Hide code cell source
import numpy             as np
import pandas            as pd
import matplotlib        as mpl
import matplotlib.pyplot as plt
from   mpl_toolkits.mplot3d import axes3d
from   ipywidgets           import interactive
plt.style.use('ggplot');
%matplotlib widget

import plotly
import plotly.figure_factory as ff
import plotly.graph_objects  as go

from   datetime import datetime as d
import locale                   as l
import platform                 as p
import sys                      as s

pad = 20
print(f"{'Executed'.upper():<{pad}}: {d.now()}")
print()
print(f"{'Platform'        :<{pad}}: "
      f"{p.mac_ver()[0]} | "
      f"{p.system()} | "
      f"{p.release()} | "
      f"{p.machine()}")
print(f"{''                :<{pad}}: {l.getpreferredencoding()}")
print()
print(f"{'Python'          :<{pad}}: {s.version}")
print(f"{''                :<{pad}}: {s.version_info}")
print(f"{''                :<{pad}}: {p.python_implementation()}")
print()
print(f"{'Matplotlib'      :<{pad}}: {mpl   .__version__}")
print(f"{'NumPy'           :<{pad}}: {np    .__version__}")
print(f"{'Pandas'          :<{pad}}: {pd    .__version__}")
print(f"{'Plotly'          :<{pad}}: {plotly.__version__}")
EXECUTED            : 2024-05-21 15:46:11.672303

Platform            : 14.4.1 | Darwin | 23.4.0 | arm64
                    : UTF-8

Python              : 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ]
                    : sys.version_info(major=3, minor=11, micro=9, releaselevel='final', serial=0)
                    : CPython

Matplotlib          : 3.8.4
NumPy               : 1.26.4
Pandas              : 2.2.2
Plotly              : 5.21.0

Definition of a vector function#

A scalar-valued function (or scalar function) is a function

\(f:\mathbb{R}^n\to\mathbb{R}\)

whose output is a number.

A vector-valued function (or vector function) is a function

\( f:\mathbb{R}^n\to\mathbb{R}^m \)

whose output is a vector.

A vector function \(f:\mathbb{R}\to\mathbb{R}^3\) is parameterized

\(\mathbf{r}(t)=\langle x(t),y(t),z(t)\rangle=x(t)\mathbf{i}+y(t)\mathbf{j}+z(t)\mathbf{k}\)

where \(x(t),y(t),z(t)\) are the scalar component functions of \(\mathbf{r}(t)\).

Limit of a vector function#

If \(\mathbf{r}(t)=\langle x(t),y(t),z(t)\rangle\), then

\( \begin{aligned} \lim_{t\to a}\mathbf{r}(t)=\langle\lim_{t\to a}x(t),\lim_{t\to a}y(t),\lim_{t\to a}z(t)\rangle \end{aligned} \)

as long as the limits of the component functions exist.

In other words

\( \begin{aligned} \lim_{t\to a}\mathbf{r}(t)=\mathbf{L} \end{aligned} \)

means that the length and direction of the vector \(\mathbf{r}(t)\) approach the length and direction of the vector \(\mathbf{L}\).

Continuity of a vector function#

A vector function \(\mathbf{r}\) is continuous at \(a\) if

\( \begin{aligned} \lim_{t\to a}\mathbf{r}(t) &=\mathbf{r}(a) \\ \langle\lim_{t\to a}x(t),\lim_{t\to a}y(t),\lim_{t\to a}z(t)\rangle &=\langle x(a),y(a),z(a)\rangle \end{aligned} \)

In other words, \(\mathbf{r}\) is continuous at \(a\) iff its component functions are continuous at \(a\).

Space Curve#

Let \(f,g,h\) be continuous scalar functions on an interval \(I\).

Then a space curve is given by the set \(C=\{(x,y,z)\mid x=f(t),y=g(t),z=h(t),t\in I\}\)

where \(x=f(t),y=g(t),z=h(t)\) are the parametric equations of \(C\) and \(t\) is the parameter.

Parameterization of a Line#

\( \begin{aligned} \mathbf{x}(t) &=\langle x_0+tv_x,y_0+tv_y,z_0+tv_z\rangle \\ &=\langle x_0,y_0,z_0\rangle+t\langle v_x,v_y,v_z\rangle \\ &=\mathbf{x}_0+t\mathbf{v} \end{aligned} \)

where

\( \begin{aligned} x(t)&=x_0+tv_x \\ y(t)&=y_0+tv_y \\ z(t)&=z_0+tv_z \end{aligned} \)

are the parametric equations of a line passing through the point \(\mathbf{x}_0=(x_0,y_0,z_0)\) and parallel to the vector \(\mathbf{v}=\langle v_x,v_y,v_z\rangle\).


Examples#

\(\mathbf{r}(t)=\langle t^2-2t,t+1\rangle\)#

\( \begin{aligned} \mathbf{r}(t) &=\langle t^2-2t,t+1\rangle =(t^2-2t)\mathbf{i}+(t+1)\mathbf{j} \\ &=\langle x(t),y(t)\rangle \\ x(t)&=t^2-2t \\ y(t)&=t+1 \end{aligned} \)

Hide code cell source
t=np.linspace(-2,2,300)

x=t**2-2*t
y=t+1

fig=plt.figure();
ax =plt.subplot();
ax.set_aspect(1);
ax.plot(x,y);
ax.set_xlabel('x');
ax.set_ylabel('y');

Circle \(\mathbf{r}(t)=\langle\cos t,\sin t\rangle\)#

\( \begin{aligned} \mathbf{r}(t) &=\langle\cos t,\sin t\rangle =(\cos t)\mathbf{i}+(\sin t)\mathbf{j} \\ &=\langle x(t),y(t)\rangle \\ x(t)&=\cos t \\ y(t)&=\sin t \end{aligned} \)

t=np.linspace(0,2*np.pi,300)

x=np.cos(t)
y=np.sin(t)

fig=plt.figure();
ax =plt.subplot();
ax.set_aspect(1);
ax.plot(x,y);
ax.set_xlabel('x');
ax.set_ylabel('y');

\(\mathbf{r}(t)=\langle t^3,\ln(3-t),\sqrt{t}\rangle\)#

\( \begin{aligned} \mathbf{r}(t) &=\langle t^3,\ln(3-t),\sqrt{t}\rangle =t^3\mathbf{i}+\ln(3-t)\mathbf{j}+\sqrt{t}\mathbf{k} \\ &=\langle x(t),y(t),z(t)\rangle \\ x(t)&=t^3 \\ y(t)&=\ln(3-t) \\ z(t)&=\sqrt{t} \end{aligned} \)

What is the domain of \(\mathbf{r}(t)\)?

\(\ln(3-t)\) is defined when \(3-t\gt0\iff3\gt t\)

\(\sqrt{t}\) is defined when \(t\ge0\)

Therefore, the domain of \(\mathbf{r}(t)\) is

\(3\gt t\ge0\)

Hide code cell source
t=np.linspace(0,2.99,300)

x=t**3
y=np.log(3-t)
z=np.sqrt(t)

fig=plt.figure();
ax =plt.subplot(projection='3d');
ax.plot(x,y,z);
ax.set_xlabel('x');
ax.set_ylabel('y');
ax.set_zlabel('z');
ax.view_init(25,25);

Line \(\mathbf{r}(t)=\langle1+t,2+5t,-1+6t\rangle\)#

\( \begin{aligned} \mathbf{r}(t) &=\langle1+t,2+5t,-1+6t\rangle =(1+t)\mathbf{i}+(2+5t)\mathbf{j}+(-1+6t)\mathbf{k} \\ &=\langle1,2,-1\rangle+t\langle1,5,6\rangle \\ &=\mathbf{r}_0+t\mathbf{v} \,\,\,\text{where}\,\,\, \mathbf{r}_0=\langle1,2,-1\rangle \,\,\,\text{and}\,\,\, \mathbf{v}=\langle1,5,6\rangle \\ &=\langle x(t),y(t),z(t)\rangle \\ x(t)&=1+t \\ y(t)&=2+5t \\ z(t)&=-1+6t \end{aligned} \)

Hide code cell source
t=np.linspace(0,2.99,300)

x=1+t
y=2+5*t
z=-1+6*t

fig=plt.figure();
ax =plt.subplot(projection='3d');
ax.plot(x,y,z);
ax.set_xlabel('x');
ax.set_ylabel('y');
ax.set_zlabel('z');
ax.view_init(25,10);

Helix \(\mathbf{r}(t)=\langle\cos t,\sin t,t\rangle\)#

\( \begin{aligned} \mathbf{r}(t) &=\langle\cos t,\sin t,t\rangle =(\cos t)\mathbf{i}+(\sin t)\mathbf{j}+t\mathbf{k} \\ &=\langle x(t),y(t),z(t)\rangle \\ x(t)&=\cos t \\ y(t)&=\sin t \\ z(t)&=t \end{aligned} \)

Hide code cell source
t=np.linspace(0,20,300)

x=np.cos(t)
y=np.sin(t)
z=t

fig=plt.figure();
ax =plt.subplot(projection='3d');
ax.plot(x,y,z);
ax.set_xlabel('x');
ax.set_ylabel('y');
ax.set_zlabel('z');
ax.view_init(10,20);

Toroidal Spiral \(\mathbf{r}(t)=\langle(4+\sin20t)\cos t,(4+\sin20t)\sin t,\cos20t\rangle\)#

\( \begin{aligned} \mathbf{r}(t) &=\langle(4+\sin20t)\cos t,(4+\sin20t)\sin t,\cos20t\rangle =((4+\sin20t)\cos t)\mathbf{i}+((4+\sin20t)\sin t)\mathbf{j}+(\cos20t)\mathbf{k} \\ x(t)&=(4+\sin20t)\cos t \\ y(t)&=(4+\sin20t)\sin t \\ z(t)&=\cos20t \end{aligned} \)

Hide code cell source
t=np.linspace(0,2*np.pi,3000)

x=(4+np.sin(20*t))*np.cos(t)
y=(4+np.sin(20*t))*np.sin(t)
z=np.cos(20*t)

fig=plt.figure();
ax =plt.subplot(projection='3d');
ax.plot(x,y,z);
ax.set_xticks(np.arange(-5,6));
ax.set_yticks(np.arange(-5,6));
ax.set_zticks(np.arange(-5,6));
ax.set_xlabel('x');
ax.set_ylabel('y');
ax.set_zlabel('z');
ax.view_init(40,50);