2

How with TikZ to draw three half-lines from one (center) point, with equal angles between each two of the half-lines?

I attach a rough drawing:

draft

The main question is how to calculate the coordinates of the end-points of the lines.

13

Use polar coordinates.

Dividing 360 by the number or your segments and using a \foreach, you don't even need to calculate your angles manually.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}       
\begin{document}
    \begin{tikzpicture}
        \node[draw, fill=cyan, ellipse, text width=4pt] (a) {};
        \draw (a) -- +(0:4cm);
        \draw (a) -- +(120:4cm);
        \draw (a) -- +(240:4cm);
    \end{tikzpicture}

    You could also use a foreach: dividing 360 by the number or segments,
    you don't even need to calculate your angles manually.

    \begin{tikzpicture}
        \node[draw, fill=cyan, ellipse, text width=4pt] (a) {};
        \pgfmathsetmacro{\myangle}{360/3}
        \foreach \i in {0,1,2}
            \draw (a) -- +(\i*\myangle:4cm);
    \end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.