13.8: Cross Product of Two Vectors

Fundamentals of MATLAB Programming · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    Read aloud

    How

    Speed: 1×
    Light up
    Highlight

    Symbols: Mulberry Symbols, © 2018–2026 Steve Lee, CC BY-SA 4.0 (licence, the set), the site's own copies.

    From LibreTexts, under CC BY-NC-SA, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    13.8: Cross Product of Two Vectors

    The cross product combines two three-dimensional vectors and returns another vector. The result is perpendicular to both original vectors. In MATLAB, use the cross function.

    Example \(\PageIndex{1}\)

    Calculating the corss product of two vectors.

    A = [4 -1 2];
    
    B = [2 -2 -1];
    
    C = cross(A,B)
    Solution
    C = 5   8  -6

    Calculating Torque

    A common physical example of the cross product is calculating torque. When a force is applied to rotate an object, the torque is calculated as the cross product of the position vector and the force vector. The result is another vector whose direction shows the axis of rotation.

    Torque measures how strongly a force tends to rotate an object around a point or axis. In vector form:

    \(
    \vec{\tau} = \vec{r} \times \vec{F}
    \)

    where \(\vec{r}\) is the position vector from the pivot point to where the force is applied, and \(\vec{F}\) is the force vector.

    For example, imagine using a wrench to loosen a bolt. The position vector \(\vec{r}\) points from the center of the bolt to the point where your hand applies the force. The force vector \(\vec{F}\) points in the direction you push or pull. The cross product gives the torque vector, which points along the axis of rotation.

    Example \(\PageIndex{2}\)

    Calculating the torque.

    r = [0.3 0 0]; % position vector in meters
    
    F = [0 20 0]; % force vector in newtons
    
    torque = cross(r, F)
    Solution

    torque = [0 0 6]

    This means the torque has a magnitude of 6 N·m and points in the positive z-direction.

    Caution

    The cross product is defined for three-dimensional vectors. If you try to use it with vectors that do not have the correct dimensions, MATLAB will give an error.


    This page titled 13.8: Cross Product of Two Vectors was last modified on Tue, 30 Jun 2026 02:11:59 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Zara Noroozi.