[Tex/LaTex] calculate a square or square root to include as coordinates in a tikz picture

calculationstikz-pgf

I am trying to draw the folding lines of a paper plane. This as a template for my kids to learn how to fold a paper plane. I came as far as:

% based on http://michaelgoerz.net/blog/2009/07/printable-paper-with-latex-and-tikz/
\documentclass[a4paper, 10pt]{article} % for A4 size paper
\usepackage{tikz}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[remember picture, overlay]   
\tikzset{normal lines/.style={gray, very thin}} 
\tikzset{margin lines/.style={gray, thick}} 
\tikzset{mm lines/.style={gray, ultra thin}} 
\tikzset{strong lines/.style={black, very thin}} 
\tikzset{master lines/.style={black, very thick}} 
\tikzset{dashed master lines/.style={loosely dashed, black, very thick}}  
\node at (current page.south west){
  \begin{tikzpicture}[remember picture, overlay]   
    \draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(0.5*\paperwidth,0); %middenlijn
    \draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(\paperwidth,\paperheight-0.5*\paperwidth); %korte vleugel1
    \draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(0,\paperheight-0.5*\paperwidth); %korte vleugel2
  \end{tikzpicture}
};
\end{tikzpicture} \end{document}

The result:
enter image description here

For the next folding line I need to know the length of the first folding lines. To calculate this I need just to perform a simple Pythagorean theorem consisting of a square root of the sum of two times the square of 0.5*\paperwidth. I thought the following would do the trick.

\pgfmathparse{sqrt({(0.5*{\paperwidth})^2}+{pow((0.5*{\paperwidth})^2)})};
\draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(0.5*\paperwidth,\paperheight-0.5*\pgfmathresult) ; 

unfortunately I didn't get the expected result. What am I doing wrong, or how should I calculate a squareroot or square of \paperwidth?

Best Answer

I'm not entirely sure of what you're trying to create here. This is my guess

\documentclass[a4paper, 10pt]{article} % for A4 size paper
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\pagestyle{empty}

\begin{tikzpicture}[remember picture, 
                    overlay,
                    normal lines/.style={gray, very thin},
                    margin lines/.style={gray, thick},
                    mm lines/.style={gray, ultra thin}, 
                    strong lines/.style={black, very thin}, 
                    master lines/.style={black, very thick}, 
                    dashed master lines/.style={loosely dashed, black, very thick}
                   ]

  \coordinate (origin) at (current page.north west);
  \path 
        [draw,dashed] (current page.north) -- (current page.south)
        [draw,dashed] (current page.north) -- ($(current page.north west)+(0,-0.5\paperwidth)$)
        [draw,dashed] (current page.north) -- ($(current page.north east)+(0,-0.5\paperwidth)$)
        [draw,dashed] (current page.south) -- ($(current page.south west)+(0,0.5\paperwidth)$)
        [draw,dashed] (current page.south) -- ($(current page.south east)+(0,0.5\paperwidth)$)
        ;

\end{tikzpicture} 

\end{document}1

which produces

enter image description here

Here's an approach which illustrates what @Qrrbrbirlbel was suggesting (though I'm sure this is not the image you're after)

\documentclass[a4paper, 10pt]{article} % for A4 size paper
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\pagestyle{empty}

\begin{tikzpicture}[remember picture, 
                    overlay,
                    normal lines/.style={gray, very thin},
                    margin lines/.style={gray, thick},
                    mm lines/.style={gray, ultra thin}, 
                    strong lines/.style={black, very thin}, 
                    master lines/.style={black, very thick}, 
                    dashed master lines/.style={loosely dashed, black, very thick}
                   ]

  \coordinate (origin) at (current page.north west);
  \path 
        coordinate (my top center) at (current page.north) 
        coordinate (my bot center) at (current page.south)
        coordinate (my top left)   at ($(current page.north west)+(0,-0.5\paperwidth)$)
        coordinate (my top right)  at ($(current page.north east)+(0,-0.5\paperwidth)$)
        coordinate (my bot left)   at ($(current page.south west)+(0,0.5\paperwidth)$)
        coordinate (my bot right)  at ($(current page.south east)+(0,0.5\paperwidth)$)
        ;
  \draw[dashed] (my top center) -- (my top left);
  \path let
          \p1=($(my top left)-(my top center)$),
          \p2=($(my top right)-(my top center)$),
          \n1={veclen(\x1,\y1)},
          \n2={atan2(\y1,\x1)},
          \n3={atan2(\y2,\x2)}
        in
        [draw,dashed] (my top left) arc (\n2:180:\n1);

\end{tikzpicture} 

\end{document}1

enter image description here

If I had a better idea of what you were after, I'm sure I could give a much better answer.