Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132928 views
License: OTHER
1
\documentclass{article}
2
\usepackage[pdftex,active,tightpage]{preview}
3
\setlength\PreviewBorder{2mm}
4
\usepackage{tikz}
5
\usepackage{tikz-3dplot}
6
7
\begin{document}
8
\begin{preview}
9
\tdplotsetmaincoords{70}{110}
10
11
\begin{tikzpicture}[scale=3,tdplot_main_coords]
12
\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
13
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
14
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};
15
\tdplotsetcoord{O}{0}{0}{0}
16
\tdplotsetcoord{P}{.8}{50}{70}
17
18
%draw a vector from origin to point (P)
19
\draw[-stealth,color=red] (O) -- (P);
20
21
%draw projection on xy plane, and a connecting line
22
\draw[dashed, color=red] (O) -- (Pxy);
23
\draw[dashed, color=red] (P) -- (Pxy);
24
\tdplotsetthetaplanecoords{70}
25
\draw[tdplot_rotated_coords,color=blue,thick,->] (0,0,0)
26
-- (.2,0,0) node[anchor=east]{$x'$};
27
\draw[tdplot_rotated_coords,color=blue,thick,->] (0,0,0)
28
-- (0,.2,0) node[anchor=north]{$y'$};
29
\draw[tdplot_rotated_coords,color=blue,thick,->] (0,0,0)
30
-- (0,0,.2) node[anchor=west]{$z'$};
31
\end{tikzpicture}
32
\end{preview}
33
\end{document}
34
35