From 002062d79b7a6d289e7306a3cd57e65d84799204 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Thu, 23 May 2019 22:21:50 +0200 Subject: [PATCH] Add a command producing the dot product of two vectors in parameters --- shortcuts/shortcuts.sty | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shortcuts/shortcuts.sty b/shortcuts/shortcuts.sty index 4f263c4..c4f1548 100644 --- a/shortcuts/shortcuts.sty +++ b/shortcuts/shortcuts.sty @@ -225,6 +225,20 @@ } } } + +%% dot product +%% +\NewDocumentCommand \dotprod{ s g g } { + \IfBooleanTF {#1} { + \ensuremath{ + \vec{#2} \cdot \vec{#3} + } + }{ + \ensuremath{ + \overrightarrow{#1\vphantom(} \cdot \overrightarrow{#2\vphantom(} + } + } +} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%