# Mark 90 degree angle in tikz in german convention

What's the best way to denote a 90 degree angle with german convention like on the following picture in tikz:

Suppose I start with something like this:

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\coordinate (O) at (0,0); %
\coordinate (A) at (1,1); %
\coordinate (B) at (1,-1); %

\draw (O) -- (A); %
\draw (O) -- (B); %

\end{tikzpicture}

\end{document}

• Nov 1, 2012 at 18:05

I'd do it with an arc and a circle.

The command \rechterWinkel takes three arguments:

• the point of the angle,
• the start angle, and
• the arc's radius (you probably want to have same-size right angles, then I suggest to hard-code the radius directly and just use two parameters).

\newcommand*{\rechterWinkelRadius}{.5cm}
\newcommand*{\rechterWinkel}[2]{% #1 = point, #2 = start angle
}


## Code

\documentclass{article}

\usepackage{tikz}

\newcommand*{\rechterWinkel}[3]{% #1 = point, #2 = start angle, #3 = radius
\draw[shift={(#2:#3)}] (#1) arc[start angle=#2, delta angle=90, radius = #3];
}
\begin{document}

\begin{tikzpicture}
\coordinate (O) at (0,0); %
\coordinate (A) at (1,1); %
\coordinate (B) at (1,-1); %

\draw (O) -- (A); %
\draw (O) -- (B); %

\rechterWinkel{0,0}{-45}{.5}
\end{tikzpicture}
\end{document}


## Output

TiKZ 3.0 introduces angles and quotes libraries which simplifies this task.

A command like

\draw pic[draw] {angle=A--O--C};


will draw a sector line between line A--O and O--C with center at O and anticlockwise. Sector radius is 5mm by default but can be changed with angle radius parameter.

This sector line can be labelled with label or with new quotes syntax. The label is placed with certain angle eccentricity (default = 0.6) which is a factor to be applied to angle radius.

Next example is similar to student's code but using angle pic.

\documentclass[border=2mm,tikz]{standalone}
\usetikzlibrary{angles,quotes}

\begin{document}

\begin{tikzpicture}
\coordinate[label=below left:O] (O) at (0,0); %
\coordinate[label=above right:A] (A) at (1,1); %
\coordinate[label=below right:B] (B) at (1,-1); %
\coordinate[label=above left:C] (C) at (-1,1);

\draw (C) -- (B); %
\draw (O) -- (A); %

\draw pic["$\cdot$", draw] {angle=B--O--A}
pic["$\cdot$", draw, angle radius=3mm, angle eccentricity=.25] {angle=A--O--C};
\end{tikzpicture}
\end{document}


• The quotes library is not needed if using pic text=$\cdot$ instead of "$\cdot$". Jul 21, 2019 at 18:55

I have found a solution which uses tkz-euclide and used Herbert's answer to

to define the optional argument of the macro.

## Code

\documentclass{article}

\usepackage{tkz-euclide}
\usetkzobj{all}

%see: https://tex.stackexchange.com/a/12893/4011
\makeatletter
\def\rechterWinkel{\@ifnextchar[\rechterWinkel@i\rechterWinkel@ii}
\def\rechterWinkel@i[#1](#2,#3,#4){%
\pgfmathsetmacro{\pos@A}{0.5*#1}
\pgfmathsetmacro{\pos@B}{0.25*#1}
\tkzMarkAngle[size=\pos@A](#2,#3,#4)
\tkzLabelAngle[pos=\pos@B](#2,#3,#4){\tikz \fill (0,0) circle (0.6pt);}
}%
\def\rechterWinkel@ii(#1,#2,#3){%
\rechterWinkel@i[1](#1,#2,#3)
}%
\makeatother

\begin{document}

\begin{tikzpicture}
\coordinate (O) at (0,0); %
\coordinate (A) at (1,1); %
\coordinate (B) at (1,-1); %
\coordinate (C) at (-1,1);

\draw (O) -- (A); %
\draw (O) -- (B); %
\draw (O) -- (C); %

\rechterWinkel(B,O,A)
\rechterWinkel[0.5](A,O,C)
\end{tikzpicture}
\end{document}


## Output

Here is a solution which does NOT need TikZ 3, a package, or manually adding the angles. It makes use of positioning sloped nodes on lines.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (center) at (0,0);
\coordinate (A) at (1,1);
\coordinate (B) at (1,-1);

\draw (B) -- (center) -- (A);

%% Some parameters:
\providecommand{\rightAngleMarkSize}{1ex}
\providecommand{\rightAngleDotSize}{0.5pt}
\providecommand{\rightAngleDotPosition}{0.55}

%% Make a rectangle to find some coordinates, e.g. for clipping.
%% Double size (inner sep) should be enough
\path (center) --  node (clipper) [sloped,pos=0,inner sep=2*\rightAngleMarkSize,minimum width=0] {} (A);
\begin{scope} %% limit the clipping to the node with the circle
\clip (clipper.east) -- (clipper.south east) -- (clipper.south) -- (clipper.center) -- cycle; %% only the part inside this rectangle will be shown
\path (center) -- %% place the circle on the path, so that it can be [sloped], which enables us to use its center and south east coordinates for further calculation
node (right angle circle) [pos=0,sloped,circle,draw,inner sep=\rightAngleMarkSize] {} %% this is the actual shown circle, of which ¼ is visible
(A);

%% Draw the dot:
\path (right angle circle.center) -- coordinate [pos=\rightAngleDotPosition] (right angle dot) (right angle circle.south east); %% find the dot's position first
\path (right angle dot) [fill] circle (\rightAngleDotSize);
\end{scope}

\end{tikzpicture}
\end{document}


Note: I renamed O to center because I confused it with 0 otherwise.