Ausgehend vom Beispiel

Open in Online-Editor
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{angles,calc}
\begin{document}
\begin{tikzpicture}[x={(-0.5cm,-0.5cm)},y={(1cm,0cm)},z={(0cm,1cm)},scale=2]
  \coordinate (O) at (0,0,0);
  \coordinate (Ax) at (1.5,0,0);
  \coordinate (Ay) at (0,2.5,0);
  \coordinate (Az) at (0,0,1.75);
  \coordinate (Axy) at ($(Ax)+(Ay)$);
  \coordinate (Ayz) at ($(Ay)+(Az)$);
  \coordinate (Axz) at ($(Ax)+(Az)$);
  \coordinate (A) at ($(Ax)+(Ay)+(Az)$);
  \draw[->] (0,0,0) -- (2,0,0) node[below left=-2pt] {$x$};
  \draw[->] (0,0,0) -- (0,3,0) node[right] {$y$};
  \draw[->] (0,0,0) -- (0,0,2) node[above] {$z$};
  \draw[thick] (Ax) -- (Axy) -- (Ay);
  \draw[thick] (Az) -- (Axz) -- (A) -- (Ayz) -- cycle;
  \draw[thick] (O) -- (Az);
  \draw[thick] (Ax) -- (Axz);
  \draw[thick] (Axy) -- (A);
  \draw[thick] (Ay) -- (Ayz);
  \pic [pic text=$\varphi$, pic text options={text=black},text opacity=1,draw,angle radius=8mm,blue,fill, fill opacity=0.1]{angle=Ax--O--A};
  \draw[red,thick,->] (O) -- (Ax) node[pos=0.7,above] {a};
  \draw[red,thick,->] (O) -- (Ay);
  \draw[red,thick,->] (O) -- (Az);
  \draw[red,thick,->] (O) -- (A) node[above,pos=0.5] {d};
\end{tikzpicture}
\end{document}

Winkel

würde ich gerne den Winkel phi zwischen Kante a und Raumdiagonale d so neigen (bzw. den Winkelbogen nicht als Kreis zeichnen), damit der Winkel "räumlicher" wirkt, als wenn er auf der Ebene ad liegen würde.

Ich kann es leider schwer zeichnen, was ich meine: In etwa so, nur dass der Winkel später nicht so groß dargestellt sein soll.

Winkel 2

Ist dies mit der angle library möglich oder gibt es eine andere (einfache) Lösung dafür?

gefragt 28 Sep '16, 15:16

tom75's gravatar image

tom75
2.2k187884
Akzeptiert-Rate: 57%

bearbeitet 29 Sep '16, 11:06

Ich bin ein grafischer DAU, habe aber Probleme mir vorzustellen, wie das geneigt aussehen soll. Ich würde stattdessen den Winkel nach (und damit über statt unter) den roten Linien und etwas stärker überdeckend, beispielsweise mit \pic [pic text=$\varphi$, pic text options={text=black},text opacity=1,draw,angle radius=8mm,blue!25,fill, fill opacity=0.9]{angle=Ax--O--A};, zeichnen.

(28 Sep '16, 17:02) saputello

@saputello Danke für den Tipp. Ich hab oben noch ein Bild eingefügt, um zu zeigen, was ich meine. (In Büchern wird das oft so dargestellt.)

(28 Sep '16, 17:22) tom75

Leider sind die ganzen Sachen wie circle oder arc auf die x-y-Ebene beschränkt. Für echte 3D-Winkel musst du tikz-3dplot verwenden.

(28 Sep '16, 18:13) Henri

Hier eine Variante mit tikz-3dplot. Ich vermute aber mal, dass das nicht das ist wonach du suchst.

Open in Online-Editor
\documentclass{standalone}
\usepackage{tikz,tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{100}
\begin{tikzpicture}[scale=2,tdplot_main_coords]
  \tdplotdefinepoints(0,0,0)(1.5,0,0)(1.5,2.5,1.75)

  \coordinate (O) at (\tdplotvertexx,\tdplotvertexy,\tdplotvertexz);
  \coordinate (Ax) at (\tdplotbx,0,0);
  \coordinate (Ay) at (0,\tdplotby,0);
  \coordinate (Az) at (0,0,\tdplotbz);
  \coordinate (Axy) at (\tdplotbx,\tdplotby,0);
  \coordinate (Ayz) at (0,\tdplotby,\tdplotbz);
  \coordinate (Axz) at (\tdplotbx,0,\tdplotbz);
  \coordinate (A) at (\tdplotbx,\tdplotby,\tdplotbz);

  \draw[->] (0,0,0) -- (2,0,0) node[below left=-2pt] {$x$};
  \draw[->] (0,0,0) -- (0,3,0) node[right] {$y$};
  \draw[->] (0,0,0) -- (0,0,2) node[above] {$z$};
  \draw[thick] (Ax) -- (Axy) -- (Ay);
  \draw[thick] (Az) -- (Axz) -- (A) -- (Ayz) -- cycle;
  \draw[thick] (O) -- (Az);
  \draw[thick] (Ax) -- (Axz);
  \draw[thick] (Axy) -- (A);
  \draw[thick] (Ay) -- (Ayz);
  \draw[red,thick,->] (O) -- (Ax) node[pos=0.7,above] {a};
  \draw[red,thick,->] (O) -- (Ay);
  \draw[red,thick,->] (O) -- (Az);
  \draw[red,thick,->] (O) -- (A) node[above,pos=0.5] {d};

  \tdplotdrawpolytopearc[blue,thick]{1}{anchor=north west}{$\theta$}
\end{tikzpicture}
\end{document}

alt text


EDIT: Man kann die Definition von \tdplotdrawpolytopearc so anpassen, dass er auch gefüllt werden kann. Man kann auch die Transformation anpassen was ich in \tdplotsetmycoords gemacht habe. Allerdings weiß ich nicht wieviel dabei kaputt geht. Benutzung auf eigene Gefahr.

Open in Online-Editor
\documentclass{standalone}
\usepackage{tikz,tikz-3dplot}

\renewcommand\tdplotdrawpolytopearc[4][]{%

    %determine vector lengths
    \pgfmathsetmacro{\ax}{\tdplotax - \tdplotvertexx}
    \pgfmathsetmacro{\ay}{\tdplotay - \tdplotvertexy}
    \pgfmathsetmacro{\az}{\tdplotaz - \tdplotvertexz}

    \pgfmathsetmacro{\bx}{\tdplotbx - \tdplotvertexx}
    \pgfmathsetmacro{\by}{\tdplotby - \tdplotvertexy}
    \pgfmathsetmacro{\bz}{\tdplotbz - \tdplotvertexz}

    %determine normal to vectors
    \tdplotcrossprod(\ax,\ay,\az)(\bx,\by,\bz)

    %DEBUG: show the cross product
    %\draw[->,blue] (\tdplotvertexx,\tdplotvertexy,\tdplotvertexz) 
        -- ++(\tdplotresx,\tdplotresy,\tdplotresz);

    %get angles for this vector
    \tdplotgetpolarcoords{\tdplotresx}{\tdplotresy}{\tdplotresz}

    \typeout{angles for cross product: phi: \tdplotresphi theta: \tdplotrestheta}

    %place the rotated coordinate system so that the z' axis points along this vector
    \tdplotsetrotatedcoords{\tdplotresphi}{\tdplotrestheta}{0}
    \coordinate (Vertex) at (\tdplotvertexx,\tdplotvertexy,\tdplotvertexz);
    \tdplotsetrotatedcoordsorigin{(Vertex)}

    %calculate the start angle of the arc
    \tdplottransformmainrot{\ax}{\ay}{\az}
    \tdplotgetpolarcoords{\tdplotresx}{\tdplotresy}{\tdplotresz}
    \pgfmathsetmacro{\tdplotstartphi}{\tdplotresphi}

    %calculate the end angle of the arc
    \tdplottransformmainrot{\bx}{\by}{\bz}
    \tdplotgetpolarcoords{\tdplotresx}{\tdplotresy}{\tdplotresz}

    %draw the arc
    \pgfmathparse{\tdplotstartphi < \tdplotresphi}
    \ifthenelse{\equal{\pgfmathresult}{1}}%
        {}%
        {
            \pgfmathsetmacro{\tdplotstartphi}{\tdplotstartphi - 360}
        }

    \draw[tdplot_rotated_coords,#1] (0,0,0) + (\tdplotstartphi:#2) arc (\tdplotstartphi:\tdplotresphi:#2);

    \fill[tdplot_rotated_coords,#1] (0,0,0) + (\tdplotstartphi:#2) arc (\tdplotstartphi:\tdplotresphi:#2) -- (0,0,0) -- (\tdplotstartphi:#2);

    \pgfmathsetmacro{\tdplotresphi}{(\tdplotresphi + \tdplotstartphi)/2}

    \draw[tdplot_rotated_coords] (0,0,0) + (\tdplotresphi:#2) node[#3]{#4};
}

\newcommand\tdplotsetmycoords{%
  \pgfmathsetmacro{\raarot}{-.5}%
  \pgfmathsetmacro{\rbarot}{-.5}%
  % 
  \pgfmathsetmacro{\rabrot}{1}%
  \pgfmathsetmacro{\rbbrot}{0}%
  % 
  \pgfmathsetmacro{\racrot}{0}%
  \pgfmathsetmacro{\rbcrot}{1}%
  % 
  \tikzset{tdplot_main_coords/.style={x={(\raarot cm,\rbarot cm)},y={(\rabrot cm, \rbbrot cm)},z={(\racrot cm, \rbcrot cm)}}}%
}

\begin{document}

\tdplotsetmycoords
\begin{tikzpicture}[scale=2,tdplot_main_coords]
  \tdplotdefinepoints(0,0,0)(1.5,0,0)(1.5,2.5,1.75)

  \coordinate (O) at (\tdplotvertexx,\tdplotvertexy,\tdplotvertexz);
  \coordinate (Ax) at (\tdplotbx,0,0);
  \coordinate (Ay) at (0,\tdplotby,0);
  \coordinate (Az) at (0,0,\tdplotbz);
  \coordinate (Axy) at (\tdplotbx,\tdplotby,0);
  \coordinate (Ayz) at (0,\tdplotby,\tdplotbz);
  \coordinate (Axz) at (\tdplotbx,0,\tdplotbz);
  \coordinate (A) at (\tdplotbx,\tdplotby,\tdplotbz);

  \draw[->] (0,0,0) -- (2,0,0) node[below left=-2pt] {$x$};
  \draw[->] (0,0,0) -- (0,3,0) node[right] {$y$};
  \draw[->] (0,0,0) -- (0,0,2) node[above] {$z$};
  \draw[thick] (Ax) -- (Axy) -- (Ay);
  \draw[thick] (Az) -- (Axz) -- (A) -- (Ayz) -- cycle;
  \draw[thick] (O) -- (Az);
  \draw[thick] (Ax) -- (Axz);
  \draw[thick] (Axy) -- (A);
  \draw[thick] (Ay) -- (Ayz);
  \draw[red,thick,->] (O) -- (Ax) node[pos=0.7,above] {a};
  \draw[red,thick,->] (O) -- (Ay);
  \draw[red,thick,->] (O) -- (Az);
  \draw[red,thick,->] (O) -- (A) node[above,pos=0.5] {d};

  \tdplotdrawpolytopearc[blue,thick,fill opacity=0.1]{1}{above left=-4pt,blue}{$\theta$}
\end{tikzpicture}
\end{document}

alt text

Permanenter link

beantwortet 28 Sep '16, 18:34

Henri's gravatar image

Henri
15.7k133943
Akzeptiert-Rate: 46%

bearbeitet 29 Sep '16, 16:34

@Henri Danke für den Vorschlag. Der Winkel sieht gut aus, das Koordinatensystem passt nicht so ganz zum Rest des Dokuments, da müsste ich dann wohl alles auf tikz-3dplot umstellen. Gibt es dort auch die Möglichkeit, den Winkel farbig zu füllen? Dass theta außerhalb steht, damit könnte ich leben.

(29 Sep '16, 11:05) tom75

@Henri Herzlichen dank, das sieht gut aus!

(01 Okt '16, 09:56) tom75

Macht tikz-3dplot m.E. nicht so schön. Ggf. kann man den blauen Bogen etwas mehr krümmen.

(01 Okt '16, 16:17) cis

@cis Dann stimmt aber die Perspektive vermutlich nicht mehr. Vgl. das Beispiel aus der Frage. Wenn man fast von vorn auf eine Kreisscheibe schaut, ähnelt die tatsächlich mehr und mehr einer geraden Linie.

(01 Okt '16, 17:12) saputello
Deine Antwort
Vorschau umschalten

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs fügen Sie einfach zwei Leerzeichen an die Stelle an der die neue Linie sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Frage-Themen:

×728
×9

gestellte Frage: 28 Sep '16, 15:16

Frage wurde gesehen: 7,287 Mal

zuletzt geändert: 01 Okt '16, 17:13