#Vectors math problem
11 messages · Page 1 of 1 (latest)
no
length is a positive function.
note that length is calculated by |v| = sqrt(v^2)
vector magnitude and length is the same thing so youre in the clear
\pgfkeys{/pgf/number format/.cd,fixed,int detect,precision=2,relative*={0}}
\pgfmathsetmacro\vx{12}
\pgfmathsetmacro\vy{0}
\pgfmathsetmacro\k{-3/2}
\pgfmathparse{veclen(\vx,\vy)}
\pgfmathsetmacro\vlen{\pgfmathresult}
\begin{figure}
\begin{tikzpicture}[x=5cm/\vlen,y=5cm/\vlen,]
% first arrow
\draw[-latex,blue!40] (0,0) -- (\vx,\vy) node [midway,sloped,above] {$\lVert{\vec{v}}\rVert = \pgfmathprintnumber{\vlen}$};
% scaled arrow
\pgfmathparse{\k * veclen(\vx,\vy)}
\pgfmathsetmacro\vlen{\pgfmathresult}
\draw[-latex,red!40] (0,0) -- (\k * \vx, \k * \vy) node [midway,sloped,above] {$\lVert kv \rVert = \pgfmathprintnumber{\vlen}$};
\end{tikzpicture}
\caption*{length of vector $\color{blue!40}\vec{v} = (\vx, \vy)$ and scaled vector $\color{red!40}k\vec{v}$ with $k = \k$}
\end{figure}
vin100
.close