Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

In LaTeX, how can I typeset the cross product (\vec c) formula of two 3d vectors (\vec a…

  1. User

    In LaTeX, how can I typeset the cross product (\vec c) formula of two 3d vectors (\vec a \cross \vec b)? The computation would be the determinant method.

    It should be something like \vec c = ([2x2 matrix], -[2x2 matrix] , [2x2 matrix])

  2. Assistant

    To typeset the cross product of two 3D vectors using the determinant method in LaTeX, you can use the array environment to construct the matrix. Here’s how you can do this:

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{amssymb}
    
    \begin{document}
    
    The cross product of two vectors \(\vec{a}\) and \(\vec{b}\) is given by:
    
    \[
    \vec{c} = \vec{a} \times \vec{b} = \begin{vmatrix}
    \hat{i} & \hat{j} & \hat{k} \\
    a_1 & a_2 & a_3 \\
    b_1 & b_2 & b_3
    \end{vmatrix}
    = \hat{i} \begin{vmatrix} a_2 & a_3 \\ b_2 & b_3 \end{vmatrix}
    - \hat{j} \begin{vmatrix} a_1 & a_3 \\ b_1 & b_3 \end{vmatrix}
    + \hat{k} \begin{vmatrix} a_1 & a_2 \\ b_1 & b_2 \end{vmatrix}
    \]
    
    Thus, the result can be written as:
    
    \[
    \vec{c} = \left( 
    \begin{vmatrix} a_2 & a_3 \\ b_2 & b_3 \end{vmatrix}, 
    - \begin{vmatrix} a_1 & a_3 \\ b_1 & b_3 \end{vmatrix}, 
    \begin{vmatrix} a_1 & a_2 \\ b_1 & b_2 \end{vmatrix} 
    \right)
    \]
    
    \end{document}
    

    In this example:

    • The cross product (\vec{c} = \vec{a} \times \vec{b}) is shown as a determinant of a 3x3 matrix.
    • The components of the cross product are expressed as determinants of 2x2 matrices.
    • The unit vectors (\hat{i}), (\hat{j}), and (\hat{k}) are used to denote the direction of the vectors in the Cartesian coordinate system.

    To run this code, you should have a LaTeX distribution installed, such as TeX Live or MikTeX, and compile it using a LaTeX editor or command line.

  3. User

    Great. Would you do the computation for me and typeset it? I have vectors \vec a = (1, 5, 0) and \vec b = (2, 1, 0).

  4. Assistant

    Sure! Let's compute the cross product (\vec{c} = \vec{a} \times \vec{b}) for the vectors (\vec{a} = (1, 5, 0)) and (\vec{b} = (2, 1, 0)) using the determinant method.

    Given: [ \vec{a} = \begin{pmatrix} 1 \ 5 \ 0 \end{pmatrix}, \quad \vec{b} = \begin{pmatrix} 2 \ 1 \ 0 \end{pmatrix} ]

    We will set up the cross product as follows:

    [ \vec{c} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \ 1 & 5 & 0 \ 2 & 1 & 0 \end{vmatrix} ]

    Now we can compute the cross product:

    [ \vec{c} = \hat{i} \begin{vmatrix} 5 & 0 \ 1 & 0 \end{vmatrix} - \hat{j} \begin{vmatrix} 1 & 0 \ 2 & 0 \end{vmatrix} + \hat{k} \begin{vmatrix} 1 & 5 \ 2 & 1 \end{vmatrix} ]

    Now computing each of the 2x2 determinants:

    1. For ( \hat{i} ): [ \begin{vmatrix} 5 & 0 \ 1 & 0 \end{vmatrix} = (5 \times 0) - (0 \times 1) = 0 ]

    2. For ( -\hat{j} ): [ \begin{vmatrix} 1 & 0 \ 2 & 0 \end{vmatrix} = (1 \times 0) - (0 \times 2) = 0 ]

    3. For ( \hat{k} ): [ \begin{vmatrix} 1 & 5 \ 2 & 1 \end{vmatrix} = (1 \times 1) - (5 \times 2) = 1 - 10 = -9 ]

    Putting these results together:

    [ \vec{c} = \hat{i} \cdot 0 - \hat{j} \cdot 0 + \hat{k} \cdot (-9) = -9 \hat{k} ]

    Thus, the cross product is:

    [ \vec{c} = \begin{pmatrix} 0 \ 0 \ -9 \end{pmatrix} ]

    Now, let's typeset this computation in LaTeX:

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{amssymb}
    
    \begin{document}
    
    Given the vectors:
    \[
    \vec{a} = \begin{pmatrix} 1 \\ 5 \\ 0 \end{pmatrix}, \quad \vec{b} = \begin{pmatrix} 2 \\ 1 \\ 0 \end{pmatrix}
    \]
    
    The cross product \(\vec{c} = \vec{a} \times \vec{b}\) is computed as follows:
    \[
    \vec{c} = \begin{vmatrix}
    \hat{i} & \hat{j} & \hat{k} \\
    1 & 5 & 0 \\
    2 & 1 & 0
    \end{vmatrix} = \hat{i} \begin{vmatrix} 5 & 0 \\ 1 & 0 \end{vmatrix} - \hat{j} \begin{vmatrix} 1 & 0 \\ 2 & 0 \end{vmatrix} + \hat{k} \begin{vmatrix} 1 & 5 \\ 2 & 1 \end{vmatrix}
    \]
    
    Calculating the 2x2 determinants:
    1. For \(\hat{i}\):
    \[
    \begin{vmatrix} 5 & 0 \\ 1 & 0 \end{vmatrix} = (5 \cdot 0) - (0 \cdot 1) = 0
    \]
    2. For \(-\hat{j}\):
    \[
    \begin{vmatrix} 1 & 0 \\ 2 & 0 \end{vmatrix} = (1 \cdot 0) - (0 \cdot 2) = 0
    \]
    3. For \(\hat{k}\):
    \[
    \begin{vmatrix} 1 & 5 \\ 2 & 1 \end{vmatrix} = (1 \cdot 1) - (5 \cdot 2) = 1 - 10 = -9
    \]
    
    Consequently, we find:
    \[
    \vec{c} = 0 \hat{i} - 0 \hat{j} - 9 \hat{k} = \begin{pmatrix} 0 \\ 0 \\ -9 \end{pmatrix}
    \]
    
    Thus, the cross product is:
    \[
    \vec{c} = \begin{pmatrix} 0 \\ 0 \\ -9 \end{pmatrix}
    \]
    
    \end{document}
    

    You can compile this LaTeX code to see the typesetting of the cross product computation. The result is clearly shown as the cross product gives the vector ( \vec{c} = (0, 0, -9) ).