I'm trying to reproduce the following picture.

right-angle with dot in center

I've already searched, but I don't find with the dot in the center, and I have to reproduce this notation many times.

EDIT: here is what I got until now

\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (0,3);
\coordinate (D) at ($(C)!(A)!(B)$);
\draw (A)node[below left]{$A$}--(B)node[below right]{$B$}--(C)node[above left]{$C$}--cycle;
\draw[dashed] (A)--(D)node[above right]{$D$};
%I didn't tried the right angle because of the dot

EDIT2: here in Brasil we use this notation for right angles, not the empty rectangle

  • 2
    Instead of posting just an image can you post the code (in a compilable document) that you have to produce most of the image without the dot, and then people can help you with the dot. – Alan Munn Jul 29 '17 at 18:14
  • the problem is not exatly the dot, but the right angle symbol, whose difference is the dot. I'll edit the main post – geekformoney Jul 29 '17 at 18:18
  • Interesting. I've never seen a right angle symbol drawn like that, though it certainly makes sense that way. It has always been a quarter circle with a dot for me. – CodesInChaos Jul 29 '17 at 21:19

You can define your own \dotMarkRightAngle as below. Four parameters need to be entered; size of the angle (square side) and three coordinates in parentheses (#2,#3,#4) taken clock-wise.


 \draw ($(#3)!#1!(#2)$) -- 
       ($($(#3)!#1!(#2)$)!#1!90:(#2)$) --
 \path (#3) --node[circle,fill,inner sep=.5pt]{} ($($(#3)!#1!(#2)$)!#1!90:(#2)$);
\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (0,3);
\coordinate (D) at ($(C)!(A)!(B)$);
\draw (A)node[below left]{$A$}--(B)node[below right]{$B$}--(C)node[above left]{$C$}--cycle;
\draw[dashed] (A)--(D)node[above right]{$D$};


enter image description here

Also, with tkz-euclide and using \tkzMarkRightAngle and \tkzLabelAngle.


\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (0,3);
\coordinate (D) at ($(C)!(A)!(B)$);
\draw (A)node[below left]{$A$}--(B)node[below right]{$B$}--(C)node[above left]{$C$}--cycle;
\draw[dashed,draw=gray] (A)--(D)node[above right]{$D$};





enter image description here

  • very nice! to be better could have an option to change the marker square size too? EDIT: wait, I must read it again. – geekformoney Jul 29 '17 at 18:41
  • Perfect, first I thought the size parameter refered to the dot, not to the square side. – geekformoney Jul 29 '17 at 18:46

enter image description here

pure tikz:

\usetikzlibrary{calc, positioning}

dotbox/.style = {draw, minimum size=3mm,
                 inner sep=0pt, outer sep=0pt,
node distance = 0pt
\coordinate[label=below  left:$A$] (A) at (0,0);
\coordinate[label=below right:$B$] (B) at (4,0);
\coordinate[label=above  left:$C$] (C) at (0,3);
\coordinate[label=above right:$D$] (D) at ($(C)!(A)!(B)$);
\draw (A) --(B) --(C) -- cycle;
\draw[dashed] (A)--(D);
% angles
\node[dotbox=south west] at (A) {} ;
\path (D) -- node[pos=0,sloped,dotbox=north east] {} (A);

It is a bit late for this ;-) but in case it may interest someone, here is a way of producing a right angle symbol with MetaPost (with the required dot inside), heavily inspired by the macro designed by André Heck in his MetaPost tutorial, p. 47-48.

Notice that the turningnumber of the path (1 if counter-clockwise, -1 if not) ensures that the order in which the extremities endofa and endofb are given doesn't matter: the mark will be the same. Also, the coordinates of point D are not explicitly given, but computed by MetaPost itself via two implicit linear equations.

Included in a LuaLaTeX program, thanks to the luamplib package.

    vardef mark_right_angle (expr common, endofa, endofb, mark_size) =
        save tn ; tn := turningnumber(common -- endofa -- endofb -- cycle) ;
        save t; transform t; 
        t = identity 
            zscaled (mark_size*unitvector((1+tn)*endofa + (1-tn)*endofb - 2*common)) 
            shifted common;
        z1 = (1, 0); z2 = (1, 1); z3 = (0, 1);
        save rangle; path rangle; 
        rangle = (origin -- z1 -- z2 -- z3 -- cycle) transformed t; 
        draw (z1 -- z2 -- z3) transformed t;
        drawdot center rangle withpen pencircle scaled 2bp;
    enddef ;
        u = cm; pair A, B, C, D;
        mark_size := 2mm;
        A = origin; B = (4u, 0); C = (0, 3u);
        D = whatever[B,C]; (D-A) dotprod (B-C) = 0;
        label.lft(btex $A$ etex, A); label.rt(btex $B$ etex, B);
        label.lft(btex $C$ etex, C); label.urt(btex $D$ etex, D);
        draw A--B--C--cycle; draw A -- D dashed evenly;
        mark_right_angle(D, A, B, mark_size); 
        mark_right_angle(A, B, C, mark_size);

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.