Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 4

21 Jun '16, 17:48

saputello's gravatar image

saputello
11.1k174365

Wie zeichne ich den Inkreis eines Dreiecks in TikZ?

Ich habe die Koordinaten nach [diesen Angaben][1] berechnet; allerdings erhalte ich dieses Ergebnis: ![alt text][2] Daher vermute ich, dass mit dem Inkreismittelpunkt W etwas nicht stimmt. Könnte es an Rechenungenauigkeit liegen? \documentclass[border=5pt, varwidth]{standalone} %\documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath,amsfonts,amssymb} \usepackage{tikz} % \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[scale=1] % Koordinaten der Eckpunkte \def\xA{0} \def\yA{0} \def\xB{5} \def\yB{0} \def\xC{3} \def\yC{2} \coordinate (A) at (\xA,\yA); \coordinate (B) at (\xB,\yB); \coordinate (C) at (\xC,\yC); % Seitenlängen \pgfmathsetmacro{\a}{sqrt((\xA - \xC)^2 + (\yA - \yC)^2)} \pgfmathsetmacro{\b}{sqrt((\xB - \xC)^2 + (\yB - \yC)^2)} \pgfmathsetmacro{\c}{sqrt((\xA - \xB)^2 + (\yA - \yB)^2)} % Inkreis % Koordinate des Inkreismittelpunktes \pgfmathsetmacro{\P}{\a+\b+\c} \pgfmathsetmacro{\xW}{(\a*\xA + \b*\xB + \c*\xC)/\P} \pgfmathsetmacro{\yW}{(\a*\yA + \b*\yB + \c*\yC)/\P} \coordinate (W) at (\xW,\yW); % Inkreisradius \pgfmathsetmacro{\s}{\P/2} \pgfmathsetmacro{\r}{sqrt(((\s-\a)*(\s-\b)*(\s-\c))/\s)} % Inkreis zeichnen \draw[blue] (W) circle[radius=\r]; % Winkelhalbierende \draw (W) -- (A); \draw (W) -- (B); \draw (W) -- (C); \draw[] (A) -- (B) -- (C) -- cycle; \end{tikzpicture} \end{document} [1]: https://de.wikipedia.org/wiki/Inkreis [2]: http://texwelt.de/wissen/upfiles/9999999999999999.jpg
Klicke auf Einblenden/Ausblenden von Überarbeitungen 3

21 Jun '16, 17:37

saputello's gravatar image

saputello
11.1k174365

Wie zeichne ich den Inkreis eines Dreiecks in TikZ?

Ich habe die Koordinaten nach [diesen Angaben][1] berechnet; allerdings erhalte ich dieses Ergebnis: ![alt text][2] Daher vermute ich, dass mit dem Inkreismittelpunkt W etwas nicht stimmt. Könnte es an Rechenungenauigkeit liegen? \documentclass[border=5pt, varwidth]{standalone} %\documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath,amsfonts,amssymb} \usepackage{tikz} % \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[scale=1] % Koordinaten der Eckpunkte \def\xA{0} \def\yA{0} \def\xB{5} \def\yB{0} \def\xC{3} \def\yC{2} \coordinate (A) at (\xA,\yA); \coordinate (B) at (\xB,\yB); \coordinate (C) at (\xC,\yC); % Seitenlängen \pgfmathsetmacro{\a}{sqrt((\xA - \xC)^2 + (\yA - \yC)^2)} \pgfmathsetmacro{\b}{sqrt((\xB - \xC)^2 + (\yB - \yC)^2)} \pgfmathsetmacro{\c}{sqrt((\xA - \xB)^2 + (\yA - \yB)^2)} % Inkreis % Koordinate des Inkreismittelpunktes \pgfmathsetmacro{\P}{\a+\b+\c} \pgfmathsetmacro{\xW}{(\a*\xA + \b*\xB + \c*\xC)/\P} \pgfmathsetmacro{\yW}{(\a*\yA + \b*\yB + \c*\yC)/\P} \coordinate (W) at (\xW,\yW); % Inkreisradius \pgfmathsetmacro{\s}{\P/2} \pgfmathsetmacro{\r}{sqrt(((\s-\a)*(\s-\b)*(\s-\c))/\s)} % Inkreis zeichnen \draw[blue] (W) circle[radius=\r]; % Winkelhalbierende \draw (W) -- (A); \draw (W) -- (B); \draw (W) -- (C); \draw[] (A) -- (B) -- (C) -- cycle; \end{tikzpicture} \end{document} [1]: https://de.wikipedia.org/wiki/Inkreis [2]: http://texwelt.de/wissen/upfiles/9999999999999999.jpg
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

20 Jun '16, 14:36

cis's gravatar image

cis
9.6k103460491

Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

20 Jun '16, 14:10

cis's gravatar image

cis
9.6k103460491