5

What does numbers in 3-tuple mean? For example, starting point, terminal point and length.

By changing numbers in codes I found that left 3 tuple in the left parenthesis means starting point, and the 3-tuple in the right parenthesis means terminal point. And the second component of 3-tuple means vertical location; the first component means horizontal location, but when I change the third component, what I learned from changin the first and the second is not definite. The arrow becomes shorter or longer and the vertical and horizontal location also seem to change.

For example, if I change the second component of 3 tuple in the left parenthesis from 0 to 1, the starting point goes up.

\draw [axisline] (-3,0,0) -- (3,0,0) node[right]{$x$};
\draw [axisline] (-3,1,0) -- (3,0,0) node[right]{$the second component changed from 0 to 1$};

enter image description here

\documentclass{article}   
\usepackage{tikz}  
\begin{document}  
\begin{tikzpicture}[axisline/.style={very thick,-stealth}, rotate around y=10,]  
\draw [axisline] (-3,0,0) -- (3,0,0) node[right]{$x$};  
\draw [axisline] (0,-3,0) -- (0,3,0) node[left]{$y$};  
\draw [axisline, cyan] (0,0,0) -- (0,0,2) node[right]{$z$};  
\end{tikzpicture}  
\end{document}
3
  • 3
    They are x, y and z values for a 3D coordinate system
    – Ignasi
    Apr 8, 2016 at 6:48
  • @Ignasi So the third component in 3 tuple means z value? But why x, y values as well as z value seem to change when I change the third component in the 3-tuple?
    – buzzee
    Apr 8, 2016 at 6:59
  • 1
    you are using a 2D printer so z direction is approximated by projection into x and y Apr 8, 2016 at 7:05

1 Answer 1

5

Some example with your code.

Let's start drawing the unit vectors of our coordinate system:

\documentclass[tikz,border=2mm]{standalone}   
\usepackage{tikz}  
\begin{document}  
\begin{tikzpicture}[axisline/.style={very thick,-stealth}]  

\draw[axisline] (0,0,0)--(1,0,0) node[right]{$x$};
\draw[axisline] (0,0,0)--(0,1,0) node[above]{$y$};
\draw[axisline] (0,0,0)--(0,0,1) node[below left]{$z$};

\end{tikzpicture}  
\end{document}

enter image description here

Now you can change any of this units and see what happens.

\documentclass[tikz,border=2mm]{standalone}   
\usepackage{tikz}  
\begin{document}  
\begin{tikzpicture}[axisline/.style={very thick,-stealth}]  

\draw[axisline] (0,0,0)--(1,0,0) node[right]{$x$};
\draw[axisline] (0,0,0)--(0,1,0) node[above]{$y$};
\draw[axisline] (0,0,0)--(0,0,1) node[below left]{$z$};

\draw[red] (0,0,0)--(3,0,0); 
\draw[blue] (0,0,0)--(0,3,0); 
\draw[green] (0,0,0)--(0,0,-4); 
\end{tikzpicture}  
\end{document}

enter image description here

If default 3D representation doesn't fit your needs, you can adjust it defining new x, y, z unit vectors. More details in pgfmanual section "25.2 The XY- and XYZ-Coordinate Systems".

\documentclass[tikz,border=2mm]{standalone}   
\usepackage{tikz}  
\begin{document}  
\begin{tikzpicture}[axisline/.style={very thick,-stealth}, x={(0.867,0.5)}, z={(0.5,-.867)}]  

\draw[axisline] (0,0,0)--(1,0,0) node[right]{$x$};
\draw[axisline] (0,0,0)--(0,1,0) node[above]{$y$};
\draw[axisline] (0,0,0)--(0,0,1) node[below left]{$z$};

\draw[red] (0,0,0)--(3,0,0); 
\draw[blue] (0,0,0)--(0,3,0); 
\draw[green] (0,0,0)--(0,0,-4); 
\end{tikzpicture}  
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .