VectorCalculus - Maple Programming Help

Home : Support : Online Help : Mathematics : Vector Calculus : VectorCalculus/CrossProduct

VectorCalculus

 CrossProduct
 computes the cross product of Vectors and differential operators

 Calling Sequence CrossProduct(v1,v2) v1 &x v2

Parameters

 v1 - Vector(algebraic); Vector, Vector-valued procedure, or differential operator v2 - Vector(algebraic); Vector, Vector-valued procedure, or differential operator

Description

 • The CrossProduct(v1, v2) function (vector product) computes the cross product of v1 and v2, where v1 and v2 can be either three dimensional free Vectors, rooted Vectors, position Vectors, vector fields, Del or Nabla.
 • The function  and can be accessed through  &x or CrossProduct exports.
 • The behavior of cross product is contained in the following table

 $\mathrm{v1}$ coord ($\mathrm{v1}$) $\mathrm{v2}$ coord ($\mathrm{v2}$) $\mathrm{v1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{v2}$ coord ($\mathrm{v1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{v2}$) 1 free Vector cartesian free Vector cartesian free Vector cartesian free Vector curved free Vector any error 2 free Vector cartesian rooted Vector (root2) coord2 rooted Vector (root2) coord2 3 free Vector any vector field any error 4 free Vector cartesian position Vector cartesian free Vector cartesian free Vector curved position Vector cartesian error 5 rooted Vector (root1) coord1 rooted Vector (root1) coord1 rooted Vector coord1 rooted Vector (root1) coord1 rooted Vector (root2) coord1 error rooted Vector (any) coord1 rooted Vector (any) coord2 error 6 rooted Vector (root1) coord1 vector field coord2 $\mathrm{v1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{v2}\left(\mathrm{root1}\right)$ coord2 7 rooted Vector (root1) cartesian position Vector cartesian rooted Vector (root1) cartesian 8 vector field coord1 vector field coord1 vector field coord1 vector field coord1 vector field coord2 error 9 vector field coord1 position Vector cartesian error 10 position Vector cartesian position Vector cartesian position Vector cartesian

Examples

 > $\mathrm{restart}$
 > $\mathrm{with}\left(\mathrm{VectorCalculus}\right):$

Take the cross product of two free Vectors in cartesian coordinates.

 > $\left(⟨1,0,0⟩\right)&x\left(⟨0,-1,0⟩\right)$
 $\left({0}\right){{e}}_{{x}}{+}\left({0}\right){{e}}_{{y}}{+}\left({-1}\right){{e}}_{{z}}$ (1)
 > $\mathrm{v1}≔\mathrm{Vector}\left(\left[1,4,0\right],\mathrm{coordinates}={\mathrm{cartesian}}_{x,y,z}\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1}\\ {4}\\ {0}\end{array}\right]$ (2)
 > $\mathrm{v2}≔\mathrm{Vector}\left(\left[1,1,1\right],\mathrm{coordinates}={\mathrm{cartesian}}_{x,y,z}\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{1}\\ {1}\\ {1}\end{array}\right]$ (3)
 > $\mathrm{CrossProduct}\left(\mathrm{v1},\mathrm{v2}\right)$
 $\left({4}\right){{e}}_{{x}}{+}\left({-1}\right){{e}}_{{y}}{+}\left({-3}\right){{e}}_{{z}}$ (4)
 > $\mathrm{GetCoordinates}\left(\mathrm{CrossProduct}\left(\mathrm{v1},\mathrm{v2}\right)\right)$
 ${{\mathrm{cartesian}}}_{{x}{,}{y}{,}{z}}$ (5)

Take the cross product of two rooted vectors if they have the same coordinate system and root point.

 > $\mathrm{vs}≔\mathrm{VectorSpace}\left(\left[1,\frac{\mathrm{Pi}}{3},\frac{\mathrm{Pi}}{3}\right],{\mathrm{spherical}}_{r,p,t}\right)$
 ${\mathrm{vs}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{_origin}}{,}{\mathrm{_coords}}{,}{\mathrm{_coords_dim}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{export}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{GetCoordinates}}{,}{\mathrm{GetRootPoint}}{,}{\mathrm{Vector}}{,}{\mathrm{eval}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (6)
 > $\mathrm{v1}≔\mathrm{RootedVector}\left(\mathrm{root}=\mathrm{vs},\left[1,1,1\right]\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1}\\ {1}\\ {1}\end{array}\right]$ (7)
 > $\mathrm{v2}≔\mathrm{RootedVector}\left(\mathrm{root}=\mathrm{vs},\left[1,0,1\right]\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{1}\\ {0}\\ {1}\end{array}\right]$ (8)
 > $\mathrm{v1}&x\mathrm{v2}$
 $\left[\begin{array}{c}{1}\\ {0}\\ {-1}\end{array}\right]$ (9)
 > $\mathrm{GetRootPoint}\left(\mathrm{v1}&x\mathrm{v2}\right)$
 $\left({1}\right){{e}}_{{r}}{+}\left(\frac{{\mathrm{\pi }}}{{3}}\right){{e}}_{{p}}{+}\left(\frac{{\mathrm{\pi }}}{{3}}\right){{e}}_{{t}}$ (10)

The cross product of a cartesian free Vector and a rooted Vector is valid. The resulting Vector is rooted.

 > $\mathrm{v1}≔\mathrm{RootedVector}\left(\mathrm{root}=\left[1,\frac{\mathrm{Pi}}{4},1\right],\left[1,1,1\right],{\mathrm{cylindrical}}_{r,p,h}\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1}\\ {1}\\ {1}\end{array}\right]$ (11)
 > $\mathrm{v2}≔\mathrm{Vector}\left(\left[0,0,1\right],\mathrm{coordinates}={\mathrm{cartesian}}_{x,y,z}\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{0}\\ {0}\\ {1}\end{array}\right]$ (12)
 > $\mathrm{v2}&x\mathrm{v1}$
 $\left[\begin{array}{c}{-1}\\ {1}\\ {0}\end{array}\right]$ (13)
 > $\mathrm{GetRootPoint}\left(\mathrm{v2}&x\mathrm{v1}\right)$
 $\left({1}\right){{e}}_{{r}}{+}\left(\frac{{\mathrm{\pi }}}{{4}}\right){{e}}_{{p}}{+}\left({1}\right){{e}}_{{h}}$ (14)
 > $\mathrm{GetCoordinates}\left(\mathrm{v2}&x\mathrm{v1}\right)$
 ${{\mathrm{cylindrical}}}_{{r}{,}{p}{,}{h}}$ (15)

The cross product of two vector fields is defined if they are in the same coordinate system.

 > $\mathrm{vf1}≔\mathrm{VectorField}\left(⟨r,\mathrm{φ},\mathrm{θ}⟩,{\mathrm{spherical}}_{r,\mathrm{φ},\mathrm{θ}}\right)$
 ${\mathrm{vf1}}{≔}\left({r}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({\mathrm{\phi }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({\mathrm{\theta }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (16)
 > $\mathrm{vf2}≔\mathrm{VectorField}\left(⟨{r}^{2},\mathrm{φ},\mathrm{φ}⟩,{\mathrm{spherical}}_{r,\mathrm{φ},\mathrm{θ}}\right)$
 ${\mathrm{vf2}}{≔}\left({{r}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({\mathrm{\phi }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({\mathrm{\phi }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (17)
 > $\mathrm{CrossProduct}\left(\mathrm{vf1},\mathrm{vf2}\right)$
 $\left({{\mathrm{\phi }}}^{{2}}{-}{\mathrm{\phi }}{}{\mathrm{\theta }}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({{r}}^{{2}}{}{\mathrm{\theta }}{-}{\mathrm{\phi }}{}{r}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({-}{\mathrm{\phi }}{}{{r}}^{{2}}{+}{\mathrm{\phi }}{}{r}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (18)

Use differential operators to compute the Curl of a vector field.

 > $F≔\mathrm{VectorField}\left(⟨1,-x,y⟩,{\mathrm{cartesian}}_{x,y,z}\right)$
 ${F}{≔}\left({1}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({-}{x}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({y}\right){\stackrel{{_}}{{e}}}_{{z}}$ (19)
 > $\mathrm{Del}&xF$
 $\left({1}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({-1}\right){\stackrel{{_}}{{e}}}_{{z}}$ (20)
 > $G≔\mathrm{VectorField}\left(⟨r,t,p⟩,{\mathrm{spherical}}_{r,p,t}\right)$
 ${G}{≔}\left({r}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({t}\right){\stackrel{{_}}{{e}}}_{{p}}{+}\left({p}\right){\stackrel{{_}}{{e}}}_{{t}}$ (21)
 > $\mathrm{Del}&xG$
 $\left(\frac{{r}{}{\mathrm{cos}}{}\left({p}\right){}{p}{+}{r}{}{\mathrm{sin}}{}\left({p}\right){-}{r}}{{{r}}^{{2}}{}{\mathrm{sin}}{}\left({p}\right)}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({-}\frac{{p}}{{r}}\right){\stackrel{{_}}{{e}}}_{{p}}{+}\left(\frac{{t}}{{r}}\right){\stackrel{{_}}{{e}}}_{{t}}$ (22)

The cross product of two position Vectors is defined. The result is a position Vector.

 > $\mathrm{pv1}≔\mathrm{PositionVector}\left(\left[1,p,q\right],{\mathrm{spherical}}_{r,\mathrm{φ},\mathrm{θ}}\right)$
 ${\mathrm{pv1}}{≔}\left[\begin{array}{c}{\mathrm{sin}}{}\left({p}\right){}{\mathrm{cos}}{}\left({q}\right)\\ {\mathrm{sin}}{}\left({p}\right){}{\mathrm{sin}}{}\left({q}\right)\\ {\mathrm{cos}}{}\left({p}\right)\end{array}\right]$ (23)
 > $\mathrm{pv2}≔\mathrm{PositionVector}\left(\left[1,p,p\right],{\mathrm{cylindrical}}_{r,\mathrm{φ},h}\right)$
 ${\mathrm{pv2}}{≔}\left[\begin{array}{c}{\mathrm{cos}}{}\left({p}\right)\\ {\mathrm{sin}}{}\left({p}\right)\\ {p}\end{array}\right]$ (24)
 > $\mathrm{CrossProduct}\left(\mathrm{pv1},\mathrm{pv2}\right)$
 $\left[\begin{array}{c}{\mathrm{sin}}{}\left({p}\right){}{\mathrm{sin}}{}\left({q}\right){}{p}{-}{\mathrm{cos}}{}\left({p}\right){}{\mathrm{sin}}{}\left({p}\right)\\ {-}{\mathrm{sin}}{}\left({p}\right){}{\mathrm{cos}}{}\left({q}\right){}{p}{+}{{\mathrm{cos}}{}\left({p}\right)}^{{2}}\\ {{\mathrm{sin}}{}\left({p}\right)}^{{2}}{}{\mathrm{cos}}{}\left({q}\right){-}{\mathrm{sin}}{}\left({p}\right){}{\mathrm{sin}}{}\left({q}\right){}{\mathrm{cos}}{}\left({p}\right)\end{array}\right]$ (25)
 > $\mathrm{About}\left(\mathrm{CrossProduct}\left(\mathrm{pv1},\mathrm{pv2}\right)\right)$
 $\left[\begin{array}{cc}{\mathrm{Type:}}& {\mathrm{Position Vector}}\\ {\mathrm{Components:}}& \left[{\mathrm{sin}}{}\left({p}\right){}{\mathrm{sin}}{}\left({q}\right){}{p}{-}{\mathrm{cos}}{}\left({p}\right){}{\mathrm{sin}}{}\left({p}\right){,}{-}{\mathrm{sin}}{}\left({p}\right){}{\mathrm{cos}}{}\left({q}\right){}{p}{+}{{\mathrm{cos}}{}\left({p}\right)}^{{2}}{,}{{\mathrm{sin}}{}\left({p}\right)}^{{2}}{}{\mathrm{cos}}{}\left({q}\right){-}{\mathrm{sin}}{}\left({p}\right){}{\mathrm{sin}}{}\left({q}\right){}{\mathrm{cos}}{}\left({p}\right)\right]\\ {\mathrm{Coordinates:}}& {\mathrm{cartesian}}\\ {\mathrm{Root Point:}}& \left[{0}{,}{0}{,}{0}\right]\end{array}\right]$ (26)