3

I've two polygons. The polygon have undergone some transformation like rotation and shifting. Suppose after the transformation, say as an example, how do I draw a perpendicular bisector from one of the vertices to the opposite edge and mark it?

    \documentclass[crop,tikz]{standalone}
    \usepackage{tikz}
    \begin{document}
    \begin{tikzpicture}[scale=1]
    \draw[draw,thick,shift={(-2.1213,0 )},rotate = 135.000316] (0,0)--
    (-1,2)--(-2,1)--(-2,-1)--(-1,-2)--(0,0)--cycle;
    \draw[fill=green!40,,draw,thick,shift={(-2.1213,0 )}] (0,0)--
    (-1,2)--(-2,1)--(-2,-1)--(-1,-2)--(0,0)--cycle;
    \draw[latex-latex,thick] (-4,0)--(1,0) node[right]{$x$};
    \draw[latex-latex,thick] (0,-3)--(0,3) node[above]{$y$};
    \end{tikzpicture}
    \end{document}

I want something like the image below. How do I generally extract information after a transformation about the edges and vertices in general? (say a midpoint of an edge, angle bisectors etc). Thanks in advance. enter image description here.

  • View tkz-euclide. Possibly exist tools in that package to achive what you want. – skpblack Aug 11 '17 at 20:36
4

Using TikZ library calc and projection modifiers, this can be achieved in two steps.

Step one, name the coordinates you need by adding coordinate (name) after the coordinates (e.g. \draw (0,0) coordinate (a) -- (1,1);. These coordinates are transformed together with the path.

Step two, draw the lines using projection modifiers. It is drawn from the point (e.g. (a)) to the line (e.g. (b)--(c)) it should be perpendicular to (e.g. \draw (a) -- ($(b)!(a)!(c)$);.

See TikZ manual for version 3.0.1a, section 13.5.5 The Syntax of Projection Modifiers.

\documentclass[crop,tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[scale=1]
\draw[thick,shift={(-2.1213,0 )},rotate = 135.000316] (0,0) coordinate (a) --
    (-1,2) coordinate (b) --(-2,1) coordinate (c) --(-2,-1)--(-1,-2)--(0,0)--cycle;
\draw[fill=green!40,thick,shift={(-2.1213,0 )}] (0,0) coordinate (d) --
    (-1,2) coordinate (e) --(-2,1) coordinate (f) --(-2,-1)--(-1,-2)--(0,0)--cycle;

\draw[blue, thick, dotted] (a) -- ($(b)!(a)!(c)$);
\draw[red, thick, dotted] (d) -- ($(e)!(d)!(f)$);

\draw[latex-latex,thick] (-4,0)--(1,0) node[right]{$x$};
\draw[latex-latex,thick] (0,-3)--(0,3) node[above]{$y$};
\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.