Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Could someone explain why my in-center has fallen outside of the triangle?

\documentclass{article}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}

  \coordinate (A) at (0,0);
  \coordinate (B) at (30:2in);

  \coordinate (tC/A) at ($(A)!1in!-30:(B)$);
  \coordinate (tC/B) at ($(B)!1in!60:(A)$);

  \tkzInterLL(tC/A,A)(tC/B,B) \tkzGetPoint {C}

  \draw (A) -- (B) -- (C) -- cycle;

  \tkzInCenter(A,B,C)
  \tkzGetPoint{cABC}
  \node at (cABC) {{\small\texttt{In-center???}}};

  \draw[red,dashed] (A) -- (cABC)
                    (B) -- (cABC)
                    (C) -- (cABC);

  \node at ($(A)+(-90:1ex)$) {A};
  \node at ($(B)+(+90:1ex)$) {B};
  \node at ($(C)+(-90:1ex)+(1ex,0)$) {C};

  \path (A) -- (B) node [midway,sloped,above=2pt] {Hypotenuse}; %%,sloped
  \path (B) -- (C) node [midway,right]            {Shorter Leg};
  \path (A) -- (C) node [midway,below]            {Longer Leg};
\end{tikzpicture}
\end{document}

enter image description here

UPDATE

Curiously enough, if I change the order of the vertices, I can get different results:

\tkzInCenter(C,A,B)

seems to provide the correct in-center. Very curious to know what's going on. My French is very shaky, but the manual seems to suggest these points can be provided in any order.

Something seems to be going wrong with \tkzDefBisectorLine(....) which is used in the definition of \tkzInCenter. In particular, if I write

  \tkzDefBisectorLine(C,A,B) \tkzGetPoint{testA}
  \draw[blue,dashed] (A) -- (testA);

  \tkzDefBisectorLine(C,B,A) \tkzGetPoint{testB}
  \draw[blue,dashed] (B) -- (testB);
  \node[inner sep=4pt,fill] at (testB) {};

The choice of an order of C,A,B and C,B,A is based upon how the definition would work with \tkzInCenter(A,B,C). The first line shows up, but testB seems to be place at the same coordinate for B.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

This seems to be a bug in the way that the angle bisector is found in tkz-euclide.

The error is showing up because the angle CBA is a 60 degree angle and the construction uses a method of creating an equilateral triangle by rotating C about a temporary point. Since angle CBA measures 60 degrees, the rotation lands squarely (triangularly??) on top of B. I'm not sure why this particular construction should have been preferred. If the temporary point is called TMP, then the mid point between C and TMP should have sufficed for placing the angle bisector.

I'm not sure where to report this bug. Could someone let me know how to do this?

It seems a bit of happenstance that I should find this particular bug while putting together a quiz on 30-60-90 triangles.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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