I would like to draw this picture:

enter image description here

The triangle ABC is a spherical one.

How can I do this using TikZ?

  • You could try to use Bezier curves.
    – projetmbc
    Apr 1 at 7:23

Here is an example made in 3d. I put in it some parameters, but it's not so very flexible. That was to avoid too long trigonometric calculations. The circles can be drawn using the canvas and rotate around options, and clipping them.

This is the code:

\usepackage    {tikz}

\def\xx{0.5} % reduction x axis, cavalier perspective
\def\aa{30}  % angles AOB=BOC
\def\r {3}   % radius
\def\l {4.5} % distance AD=AE
\pgfmathsetmacro\ay{\r*cos(\aa)} % Coordinates A
\pgfmathsetmacro\cx{\r*sin(\aa)} % Coordinates C
\pgfmathsetmacro\nx{-sin(\aa)*cos(\aa)} % normal vector OAC plane
\pgfmathsetmacro\ny{ sin(\aa)*sin(\aa)}
\pgfmathsetmacro\nn{sqrt(2*\nx*\nx+\ny*\ny)} % modulus
\pgfmathsetmacro\ap{acos(abs(\nx)/\nn)} % angle between planes XY and OAC

\begin{tikzpicture}[line cap=round,line join=round,x={(-\xx cm,-\xx cm)},y={(1 cm,0 cm)},z={(0 cm,1 cm)}]
  % coordinates
  \coordinate (O) at (0,0,0);
  \coordinate (A) at (0,\ay,\az);
  \coordinate (B) at (0,\r,0);
  \coordinate (C) at (\cx,\cy,0);
  \coordinate (D) at (0,\l,0);
  \coordinate (E) at ({\l*sin(\aa)},{\l*cos(\aa)},0);
  % labels
  \node      at (O) [left]  {$O$};
  \node      at (A) [above] {$A$};
  \node      at (B) [below] {$B$};
  \node      at (C) [below] {$C$};
  \node      at (D) [below] {$D$};
  \node      at (E) [below] {$E$};
  \node[red] at ($(B)!0.5!(C)$) [below] {$a$};
  \node[red] at ($(A)!0.5!(C)$)         {$b$};
  \node[red] at ($(A)!0.5!(B)$) [right] {$c$};
  % spheric triangle
  \begin{scope} [canvas is xy plane at z=0]
    \clip (O) -- (D) -- (E) -- cycle;
    \draw[red] (O) circle (\r);
  \begin{scope}[canvas is yz plane at x=0]
    \clip (O) -- (A) -- (D) -- cycle;
    \draw[red] (O) circle (\r);
  \begin{scope}[rotate around z=-\aa, rotate around y=\ap-90,canvas is yz plane at x=0]
    \clip (O) -- (A) -- (E) -- cycle;
    \draw[red] (O) circle (\r);
  % lines
  \draw (O) -- (A) -- (D) -- (E) -- cycle;
  \draw[dashed] (O) -- (D);
  \draw (A) -- (E);

And this is the triangle: enter image description here


You can use tikz-3dplot.

\begin{tikzpicture}[tdplot_main_coords,line cap=round,line join=round,
    declare function={Px=0.2;Py=0.4;Pz=0.6;}]
    \draw (0,0,0) coordinate[label=left:{$O$}] (O) 
    (2,0,0) coordinate[label=below:{$A$}] (A) edge (O)
    -- (2,2,0) coordinate[label=below:{$B$}] (B) edge (O)
    -- (2,1,2) coordinate[label=above:{$C$}] (C) edge (O)
    -- (A)
    -- (3,0,0) coordinate[label=below:{$E$}] (E) edge (C)
    -- (3,3,0) coordinate[label=right:{$D$}] (D) edge (C)
    -- (B);

enter image description here

  • Thanks for your answer, but the triangle ABC should be a spherical one. So the sides $AB,BC$ and $CA$ ar not stright.
    – Averroes2
    Apr 1 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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