2

I'm trying to make a perpendicular bisector between two points, so that I can specify any two points I want (marked here as A and B), and the rest of the diagram follows it. I didn't know another way to draw a perpendicular bisector with Tikz, so I used the rulercompass package in order to construct it geometrically. However, I don't want the circles to be included in the final diagram: just the intersection point that they constructed (here C).

Is there a way to use the rulercompass tools to find this intersection without actually drawing the circles (similar to how the \path command works)? I've tried changing the compass style, but I don't know the proper syntax.

Alternatively, is there a different way to specify a perpendicular bisector with only two points?

Thank you! (and sorry if my code is a bit of a mess)

\documentclass{exam}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
    \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations,decorations.markings,through,rulercompass}

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

\begin{document}
\begin{tikzpicture}
%list points and coordinates
\coordinate (vertex1) at (0,0);
\coordinate (vertex2) at (3,1);
\draw (vertex1) -- (vertex2);
\compass{vertex1}{vertex2};
\compass{vertex2}{vertex1};
\point{c{vertex1}{vertex2}}{c{vertex2}{vertex1}}{1};
\point{c{vertex1}{vertex2}}{c{vertex2}{vertex1}}{2};
\ruler{a}{b};
\draw (a)--(vertex1);
\draw (a)--(vertex2);
\draw (a)--($(vertex1)!0.5!(vertex2)$);
\node[left] at (vertex1){$A$};
\node[right] at (vertex2){$B$};
\node[below] at ($(vertex1)!0.5!(vertex2)$){$C$};
\node[above] at (a){$D$};

\end{tikzpicture}
\end{document}

enter image description here

5
  • Do you want the perpendicular line to be drawn too or only the point c ? Oct 31 '18 at 20:04
  • The intersection point is just the midpoint. This is provided for you through tkz-euclide (which you're using in your code) by \tkzDefMidPoint(A,B) \tkzGetPoint{C}. You can draw the point with \tkzDrawPoint[size=15](C). Likewise, constructing the circles with tkz-euclide doesn't require that they be drawn.
    – DJP
    Oct 31 '18 at 20:18
  • Yes, I want the perpendicular line from C to D drawn. Oct 31 '18 at 20:19
  • How do I construct the circles with tkz-euclide? I couldn't find a way to do it that didn't require specifying the radius (instead of using the center and a point on the circle) Oct 31 '18 at 20:22
  • Use \tkzDefCircle[radius](B,A) to define the circle centered at B with A on the radius.
    – DJP
    Oct 31 '18 at 20:24
3

Here is a way just using tkz-euclide, which you are already using:

\documentclass[11pt]{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}
\tkzDefPoint(0,0){A}
\tkzDefPoint(3,1){B}
\tkzDefCircle[radius](B,A)
\tkzDefCircle[radius](A,B)
\tkzInterCC(B,A)(A,B)\tkzGetPoints{M}{N}
\tkzDrawSegment(A,B)
\tkzDrawSegment[color=orange](M,N)
\tkzDefMidPoint(A,B) \tkzGetPoint{C}
\tkzDrawPoint[size=15](C)
\tkzDrawPoints[size=10](A,B)
\tkzLabelPoint[right,blue](B){$B$}
\tkzLabelPoint[left,blue](A){$A$}
\tkzLabelPoint[below right,red](C){$C$}
\end{tikzpicture}
\end{document}

The tkz-euclide package allows you to define lines, circles, etc without actually drawing them. It also has macros for getting the intersection points of two circles, two lines, or a circle and line. The code running in Gummi looks like this: enter image description here

As I mentioned, \tkzDefCircle[radius](B,A) defines the circle centered at B with A on the radius. \tkzInterCC(B,A)(A,B)\tkzGetPoints{M}{N} calculates the intersection of the two circles and calls them M and N.

1
  • 1
    That seems to do the trick. Hafid's answer apparently gets the perpendicular bisector without even needing the circles at all, which seems to be more convenient for repeated usage. Oct 31 '18 at 20:56
1

Use of \tkzDefMidPoint and \tkzDefLine from tkz-euclide package

\documentclass{exam}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
    \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations,decorations.markings,through,rulercompass}

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

\begin{document}
\begin{tikzpicture}
%list points and coordinates
\coordinate (A) at (0,0);
\coordinate (B) at (3,1);
\tkzDefMidPoint(A,B) \tkzGetPoint{C}
\tkzDefLine[mediator](A,B)\tkzGetPoints{D}{E}
\draw (A) -- (B);
\draw (D)--(E);
\node[left] at (A){$A$};
\node[right] at (B){$B$};
\node[draw ,cross out,label=above right:$C$] at(C) {};



\end{tikzpicture}
\end{document}

enter image description here

1
  • Ahh, so the "\tkzDefLine[mediator](A,B)" is what creates the perpendicular bisector. Thank you so much! Oct 31 '18 at 20:53

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.