[Tex/LaTex] How to type formula cosine of two vectors nice

math-mode

I want to find cosine of two vectors, I define the command \cross for cross product of two vectors. I tried

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{fourier}
\usepackage{esvect}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\newcommand{\cross}[2]{\biggl[\vv{#1},\vv{#2} \biggr]}
\begin{document}
\[\cos \varphi =\dfrac{\cross{CA'}{CB} \cdot \cross{CA'}{CD}}{\left \vert \cross{CA'}{CB} \right\vert \cdot \left \vert \cross{CA'}{CD} \right\vert}. \]
\end{document}

enter image description here

I feel the brackets in command \cross is not good. How can I repair them?

Best Answer

The square brackets seem to be needlessly tall. Specifically, I don't think it's necessary to make the square brackets sufficiently tall to have them enclose the arrows. Nobody should be confused by the arrows "sticking out" above the brackets. Hence, using \big instead of \bigg for the size of the brackets should be fine.

Where I also see room for improvement, typographically speaking, is in the uneven heights of the arrows that are produced by \vv. Since the uneven heights are caused by the presence of the "primes" in the first argument of the \cross macro, one way to address this issue is to automatically add a "vertical phantom" (composed of #1...) to the second argument of the \cross macro.

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\usepackage{fourier,esvect}
\usepackage[margin=2cm]{geometry}
\newcommand{\cross}[2]{\bigl[ \vv{#1},\vv{#2\vphantom{#1}} \bigr]}
\newcommand\z{\vphantom{{}'}} % insert a vertical phantom as tall as a superscript prime
\begin{document}
\[
\cos \varphi =\dfrac{\cross{CA'}{CB} \cdot \cross{CA'}{CD}}
{\abs*{\cross{CA'}{CB}} \cdot  \abs*{\cross{CA'}{CD}} }\,. 
\]
\end{document}