Ich habe mit TikZ ein rechtwinkliges Dreieck gezeichnet und möchte in diesem den rechten Winkel markieren. Wie kann ich das möglichst einfach machen? Open in writeLaTeX
\documentclass[tikz,margin=5mm]{standalone} \begin{document} \begin{tikzpicture} \draw (-2,0)coordinate[label=below:A](A) --(2,0)coordinate[label=below:B](B) --(50:2)coordinate[label=above:C](C) --cycle; \end{tikzpicture} \end{document} |
Die Version 3 von pgf/tikz bietet mit den Bibliotheken
Open in Online-Editor
\documentclass[margin=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{angles,quotes,babel,3d} \usepackage[ngerman]{babel} \begin{document} \begin{tikzpicture} \coordinate (O) at (0,0,0); \foreach \p/\n in {(1,0,0)/A,(0,1,0)/B,(0,0,1)/C} \draw[->] (O) -- \p coordinate(\n); % rechte Winkel \pic[draw,fill=yellow,fill opacity=0.3,angle radius=3mm,"$\cdot$" opacity=1] {angle=A--O--B}; \pic[draw,fill=blue!50,fill opacity=0.3,angle radius=3mm,"$\cdot$" opacity=1, canvas is yz plane at x=0 % Winkel in Ebene x=0 zeichnen ]{angle=B--O--C}; \end{tikzpicture} \end{document} Im 3-dimensionalen zeichnet man gerne einen 'eckigen rechten Winkel' (ohne Punkt). Gibt es diesen egtl. auch als Makro?
(01 Apr '14, 03:44)
cis
Der blaue Winkel sieht für mich "verzogen" aus. Der Punkt müsste näher an die Ecke und der Bogen ist auch irgendwie nicht richtig.
(03 Apr '14, 10:30)
Ulrike Fischer
Der
(03 Apr '14, 10:46)
stefan ♦♦
|
Ich habe dazu mal etwas gefunden, ich finde die Arbeit damit fast angenehmer, als mit der neuen Lib angle. Anmerkung dazu: Der Kopf dafür ist aufwendig, aber sie kommt ohne pic aus, funktioniert daher auch bei schon bei TikZ 2.12 - falls jmd. mal gezwungen sein sollte, damit zu arbeiten. Open in writeLaTeX
% \documentclass[a4paper]{article} \documentclass[margin=10mm]{standalone} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc, intersections, snakes} \newcommand\markangle[6][red]{% [color] {X} {origin} {Y} {mark} {radius} % filled circle: red by default \begin{scope} \path[clip] (#2) -- (#3) -- (#4); \fill[color=#1,fill = white,draw=#1,name path=circle] %opacity=0.5 (#3) circle (#6mm); \end{scope} % middle calculation \path[name path=line one] (#3) -- (#2); \path[name path=line two] (#3) -- (#4); \path[% name intersections={of=line one and circle, by={inter one}}, name intersections={of=line two and circle, by={inter two}} ] (inter one) -- (inter two) coordinate[pos=.5] (middle); % bissectrice definition \path[% name path=bissectrice ] (#3) -- (barycentric cs:#3=-1,middle=1.2); % put mark \path[ name intersections={of=bissectrice and circle, by={middleArc}} ] (#3) -- (middleArc) node[pos=0.6] {#5}; % node[pos=1.3] } %========= \begin{document} %========= \begin{tikzpicture}[scale=2.0] \coordinate[label=below left:$A$] (A) at (0,0); \coordinate[label=below right:$B$] (B) at (2,0); \coordinate[label=above:$C$] (C) at (0,2); \markangle[black]{C}{A}{B}{$\textcolor{black}{\cdot}$}{10}; \draw (C) --(A) -- (B); \end{tikzpicture} \begin{tikzpicture}[scale=2.0] \coordinate[label=below left:$A$] (A) at (0,0); \coordinate[label=below right:$B$] (B) at (2,0); \coordinate[label=above:$D$] (D) at (1,2); \markangle[black]{D}{A}{B}{$\textcolor{black}{\alpha}$}{10}; \draw (D) --(A) -- (B); \end{tikzpicture} %========= \end{document} %========= PS: Sorry wegen dem Schriftbild. Ich schaffs nicht mit dem Code-Posten hier. 'Enter your Code here', ok... aber trotzdem muß ich jede Zeile von Hand einrücken, das dürfte der Renner werden, wenn ich mal 20 Seiten Code posten möchte. @cis Du kannst den eingefügten Code markieren und Strg+K drücken oder statt Strg+K den Code-Button klicken.
(01 Apr '14, 08:42)
stefan ♦♦
|
Hier ist dazu etwas gesagt: http://codecoffein.wordpress.com/2014/01/03/rechter-winkel-in-tikz-latex/ |