如何绘制球面三角形?

如何绘制球面三角形?

有人知道如何使用 LaTeX 绘制球面弧和球面三角形吗?

答案1

在此处输入图片描述

以下是MWE使用Asymptote 3D绘图:

% sphtri.tex:
\documentclass{article}
\usepackage[inline]{asymptote}
\usepackage{lmodern}

\begin{document}
\begin{figure}
\centering
\begin{asy}
settings.prc=false;
settings.tex="pdflatex";
settings.render=0;

import three;
size(100); size3(100);

currentprojection=orthographic(
camera=(5.4290316601351,2.94352790610013,1.1108527434919),up=Z,target=O,zoom=0.7);
real r=1;

triple A,B,C;
A=dir(60.0,20.0);
B=dir(40.0,40.0);
C=dir(80.0,80.0);

guide3 AB=arc(O,A,B,CCW);
guide3 BC=arc(O,B,C,CCW);
guide3 CA=arc(O,C,A,CCW);

radialshade(project(circle((0,0,0),1
,currentprojection.camera-currentprojection.target))
,rgb(0.79,0.79,0.85), project(O), 1.0
,rgb(0.99,0.99,0.85), project(O), 0.2
);

guide3 g=AB--BC--CA--cycle;
fill(project(g),rgb(1,1,0.8));

draw(arc(O,A,B,CCW),red+1bp);
draw(arc(O,B,C,CCW),olive+1bp);
draw(arc(O,C,A,CCW),blue+1bp);

pen alphaPen=red;
pen betaPen=darkgreen;
pen gammaPen=blue;

void markAngle(string lab,triple v, guide3 gright, guide3 gleft, real arcdist, pen arcpen=currentpen){
  triple t,s;
  t=arcpoint(gright,arcdist); 
  s=arcpoint(gleft,arcdist);
  draw(arc(v,t,s,cross(t-v,s-v),CCW),arcpen);
  label("$"+lab+"$",(v+t+s)/3,arcpen);
}

real ra,rb,rg; 
ra=0.17; rb=0.21; rg=0.4;
markAngle("\alpha",A,reverse(CA),AB,ra,alphaPen);
markAngle("\beta",B,reverse(AB),BC,rb,betaPen);
markAngle("\gamma",C,reverse(BC),CA,rg,gammaPen);

dot(A,red); dot(B,olive); dot(C,blue);

label("$A$",project(A),SW);
label("$B$",project(B),N);
label("$C$",project(C),SE);    
\end{asy}
\caption{Spherical arcs and spherical triangles}
\end{figure}
\end{document}
% 
% To process it with `latexmk`, create file `latexmkrc`:
% 
%     sub asy {return system("asy '$_[0]'");}
%     add_cus_dep("asy","eps",0,"asy");
%     add_cus_dep("asy","pdf",0,"asy");
%     add_cus_dep("asy","tex",0,"asy");
% 
% and run `latexmk -pdf sphtri.tex`.

答案2

\documentclass{article}
\usepackage{pst-3dplot}
\begin{document}

\def\radius{4 }\def\PhiI{20 }\def\PhiII{50 }
\def\RadIs{\radius \PhiI sin mul}
\def\RadIc{\radius \PhiI cos mul}

\begin{pspicture}(-4,-4)(4,5)
  \psset{Alpha=45,Beta=30,linestyle=dashed}
  \pstThreeDSphere[linecolor=black!15](0,0,0){4}
  \pstThreeDCoor[linestyle=solid,xMin=-5,xMax=5,yMax=5,zMax=5,IIIDticks]
  \pstThreeDEllipse(\RadIs,0,0)(0,\RadIc,0)(0,0,\RadIc)
  \pstThreeDEllipse[SphericalCoor](0,0,0)(\radius,90,\PhiI)(\radius,0,0)
  \pstThreeDEllipse[SphericalCoor](0,0,0)(\radius,90,\PhiII)(\radius,0,0)
%
  \psset{linecolor=blue,arrows=->,arrowscale=2,linewidth=1.5pt,linestyle=solid}
    \pstThreeDEllipse[SphericalCoor,beginAngle=\PhiI,endAngle=90](0,0,0)(\radius,90,\PhiII)(\radius,0,0)
    \pstThreeDEllipse[SphericalCoor,beginAngle=90,endAngle=\PhiI](0,0,0)(\radius,90,\PhiI)(\radius,0,0)
    \pstThreeDEllipse[beginAngle=\PhiI,endAngle=\PhiII](\RadIs,0,0)(0,\RadIc,0)(0,0,\RadIc)
  \pscustom[fillstyle=solid,fillcolor=blue!40,opacity=0.4]{
    \pstThreeDEllipse[SphericalCoor,beginAngle=\PhiI,endAngle=90](0,0,0)(\radius,90,\PhiII)(\radius,0,0)
    \pstThreeDEllipse[SphericalCoor,beginAngle=90,endAngle=\PhiI](0,0,0)(\radius,90,\PhiI)(\radius,0,0)
    \pstThreeDEllipse[beginAngle=\PhiI,endAngle=\PhiII](\RadIs,0,0)(0,\RadIc,0)(0,0,\RadIc)
  }
\end{pspicture}

\end{document}

在此处输入图片描述

相关内容