0

I am making a small picture to explain the capacity of a car driving up a slope. I have problem controlling the labels that are next to each arrow. I would like to have them either perpendicular or parallell but they will not turn with the picture.

\documentclass[border=0.2cm]{standalone}

\usepackage{tikz} \usetikzlibrary{arrows, arrows.meta}

\begin{document}

\newcommand{\ang}{30}

\begin{tikzpicture} [font = \small]

% triangle: \draw [draw = orange, fill = orange!15] (0,0) coordinate (O) -- (\ang:10) coordinate [pos=.35] (M) |- coordinate (B) (O);

% angles: \draw [draw = orange] (O) ++(.8,0) arc (0:\ang:0.8) node [pos=.4, left] {$\theta$}; \draw [draw = orange] (B) rectangle ++(-0.3,0.3);

\begin{scope} [-latex,rotate=\ang]

% Object (rectangle) \draw [fill = purple!30, draw = purple!50] (M) ++ (0,0.2) rectangle ++ (4,1.5);

% Object (wheel1) \draw [fill=lightgray] (M) ++ (0.3,0.2) coordinate (w1) circle (.2cm); % Object (wheel2) \draw [fill=lightgray] (M) ++ (3.5,0.2) coordinate (w2) circle (.2cm);

% Weight and its projections \draw [dashed] (M) ++ (2,.9) coordinate (MM) -- ++ (0,-1.29) node [midway, right] {$mg\cos{\theta}$};

\draw [dashed] (MM) -- ++ (-0.75,0) node [very near end, left] {$mg\sin{\theta}$};

\draw (MM) -- ++ (-\ang-90:1.5) node [very near end,below left ] {$mg$};

% Normal Force 2 \draw (M) ++ (0.3,-1.1) coordinate (N2) -- ++ (0,1.1) node [very near start, left] {$N_2$}; % Normal Force 1 \draw (M) ++ (3.5,-1.1) coordinate (N1) -- ++ (0,1.1) node [very near start, right] {$N_1$};

% Speed \draw (M) ++ (1.5,2.2) coordinate (w2) -- ++ (0.75,0) node [above] {$v$};

% Traction force \draw (M) ++ (-0.8,0) coordinate (TF) -- ++ (1,0) node [very near start, above] {$F_t$};

\end{scope}

\begin{scope} [rotate=\ang]

\draw [blue] (MM) -- ++ (2.7,0) node [very near end, left] {$ $};

\draw [blue,>=triangle 45, <->] (8,0.9) -- (8,0) node [midway, right] {$h$};;

\draw [blue,>=triangle 45, <->] (3.8,-0.9) -- (5.5,-0.9) node [midway, above] {$b$};; \draw [blue,>=triangle 45, <->] (MM)++ (0,-1.8) -- (7,-0.9) node [midway, above] {$a$};;

\end{scope}

\end{tikzpicture} \end{document}

Image:

enter image description here

MS-SPO
  • 11,519
John W. de Burgh
  • 1,245
  • 1
  • 7
  • 15

0 Answers0