Ich versuche gerade, eine Kreidezeichnung in Tikz zu reproduzieren.
Derzeit versuche ich, Schnittlinien zu zeichnen, ohne die Koordinaten manuell einzugeben, wie ich es derzeit tue. Weiß jemand, wie das problemlos möglich ist – vermutlich mithilfe der Calc-Bibliothek?
Konkret spreche ich vom Zeichnen des kleinen Dreiecks QRP
und der beiden Linien, die die y-Achse schneiden:
\draw [densely dotted] (P)--($(P) + 1*(-2.7,0)$) node [left]{$\mathrm{sin}(\theta)$};
\draw [densely dotted] (Q)--($(Q) + 1*(-1.2,0)$) node [left]{$\mathrm{sin}(\theta+\Delta\theta)$};
Vollständiger Code:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [-stealth] (-0.6,0)--(4.5,0) node [right] {$x$};
\draw [-stealth] (0,-0.6)--(0,4.5) node [above] {$y$};
\draw ($(O) + 3.5*(1,0)$) arc (0:90:3.5);
\fill (O) circle (1pt) node [anchor=north east] {$O$};
\draw [-{Stealth[red!80,length=3mm,width=2mm]}] (O)--(3.5cm,0) node [midway, below] {$1$};
\fill (40:3.5cm) circle (1pt) node [above right] {$P$} coordinate (P);
\fill (70:3.5cm) circle (1pt) node [above] {$Q$} coordinate (Q);
\draw [-{Stealth[orange!80,length=3mm,width=2mm]}] (O)--(P);
\draw (O)--(Q);
\draw [-{Stealth[orange!80,length=3mm,width=2mm]}] (P)--(Q);
\draw ($(O) + 1*(1,0)$) arc (0:40:1) node [midway,right] {$\theta$};
\draw ($(O) + (40:0.8)$) arc (40:70:0.8) node [yshift=0.2cm,xshift=0.35cm] {$\Delta\theta$};
\draw [densely dotted] (P)--($(P) + 1*(-2.7,0)$) node [left]{$\mathrm{sin}(\theta)$};
\draw [densely dotted] (Q)--($(Q) + 1*(-1.2,0)$) node [left]{$\mathrm{sin}(\theta+\Delta\theta)$};
\end{tikzpicture}
\end{document}
Antwort1
Die Frage ist nicht dumm ... Ich schlage vor, einige Änderungen vorzunehmen: Verwenden Sie das Paket angles
und verwenden quotes
Sie für Winkel, Koordinaten R
und Werte auf der Y-Achse orthogonale Koordinaten -|
. Damit ist die Schnittmenge nicht mehr erforderlich:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{angles, arrows.meta, calc, quotes}
\begin{document}
\centering
\begin{tikzpicture}[
my angle/.style = {draw, Stealth-Stealth,
angle radius = 15mm,
angle eccentricity=1.3,
font=\large} % angle label position!
]
% axis
\coordinate (O) at (0,0);
\coordinate[above=44mm,label=$y$] (y);
\coordinate[right=44mm,label=right:$x$] (x);
\draw [-stealth] (-0.6,0)--(x);
\draw [-stealth] (0,-0.6)--(y);
\fill (O) circle (1pt) node [below right] {$O$};
% arc
\draw ($(O) + 3.5*(1,0)$) arc (0:90:3.5);
\draw [-{Stealth[red!80,length=3mm,width=2mm]}] (O)-- node [below] {$1$} (3.5cm,0);
% points on arc
\fill (40:3.5cm) circle (1pt) node [right] {$P$} coordinate (P);
\fill (70:3.5cm) circle (1pt) node [above] {$Q$} coordinate (Q);
\draw [-{Stealth[orange!80,length=3mm,width=2mm]}] (O)--(P);
\draw (O)--(Q);
\draw [-{Stealth[orange!80,length=3mm,width=2mm]}] (P)--(Q);
% point R /added/
\coordinate[label=above right:R] (R) at (Q -| P);
\draw[fill] (Q) -- (R) circle (1pt);
\draw [-{Stealth[red!80,length=3mm,width=2mm]}] (P)-- node [right] {$\Delta y$} (R);
% ytick
\draw [densely dotted]
(P)--(P -| O) node [left]{$\sin(\theta)$}
(Q)--(Q -| O) node [left]{$\sin(\theta+\Delta\theta)$};
% angles
\pic [my angle,"$\Delta\theta$"] {angle = P--O--Q};
\pic [my angle,"$\theta$"] {angle = x--O--P};
\end{tikzpicture}
\end{document}
Antwort2
ich würde ... benutzen
\draw [densely dotted] (P)--(P-|O) node [left]{$\sin(\theta)$};
\draw [densely dotted] (Q)--(Q-|O) node [left]{$\sin(\theta+\Delta\theta)$};
\draw [densely dotted] (Q)--(Q-|P) coordinate(R)--(P);
\fill (R) circle [radius=1pt] node [above]{$R$};
Hier ist also ein Vorschlag ohne Bibliotheken calc
und intersections
. Aber ich würde die Bibliothek verwenden angles
.
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{angles}
\begin{document}
\begin{tikzpicture}
\newcommand\radius{3.5}
\coordinate (O) at (0,0);
\draw [-stealth] (O)+(-0.6,0)--+({\radius+1.5},0) node [right] {$x$};
\draw [-stealth] (O)+(0,-0.6)--+(0,{\radius+1.5}) node [above] {$y$};
\draw (O)+(\radius,0) arc (0:90:\radius);
\fill (O) circle (1pt) node [anchor=north east] {$O$};
\draw [-{Stealth[red!80,length=3mm,width=2mm]}]
(O)--+(\radius,0)node [midway, below] {$1$} coordinate(X);
\fill (O)+(40:\radius) circle [radius=1pt] node [above right] {$P$} coordinate (P);
\fill (O)+(70:\radius) circle [radius=1pt] node [above] {$Q$} coordinate (Q);
\draw [-{Stealth[orange!80,length=3mm,width=2mm]}] (O)--(P);
\draw (O)--(Q);
\draw [-{Stealth[orange!80,length=3mm,width=2mm]}] (P)--(Q);
\pic [draw,angle radius=1cm,pic text=$\theta$,angle eccentricity=1.25]{angle=X--O--P};
\pic [draw,angle radius=.8cm,pic text=$\Delta\theta$,angle eccentricity=1.5]{angle=P--O--Q};
\draw [densely dotted] (P)--(P-|O) node [left]{$\sin(\theta)$};
\draw [densely dotted] (Q)--(Q-|O) node [left]{$\sin(\theta+\Delta\theta)$};
\draw [densely dotted] (Q)--(Q-|P) coordinate(R)--(P);
\fill (R) circle [radius=1pt] node [above]{$R$};
\end{tikzpicture}
\end{document}