其实我感觉语法没有比tikz-3d简单,反而求两个大圆交点(在luadraw-v2.6)需要花点心思...
% https://github.com/pfradin/luadraw/discussions/223#discussioncomment-16064759
\documentclass{standalone}
\usepackage[3d]{luadraw}
\usepackage[svgnames]{xcolor}
\usepackage{fourier}
\begin{document}
\begin{luadraw}{name=spherical_geometry}
local g = graph3d:new{window3d={-5, 5, -5, 5, -5, 5},window={-3,4.25,-3,4}, viewdir={30, 65}, size={12, 12}}
require 'luadraw_spherical'
local O,R = Origin,4
g:Define_sphere({radius=R, show=false, opacity=1})
local Pz, Px, Py = sM(0,0), sM(0,90), sM(90,90)
local theta = 55
local A, B = sM(theta, 90), Py
local D = sM(90,65)
local M = 0.7 * D
local N = pxy(M)
-- calculus of C and K
-- The function plane(A,B,C) returns the plane passing through the three 3d points A, B, and C (if they are not aligned,otherwise the result is nil).
local d = interPP( plane(O,Px,D), plane(O,A,Pz) )
-- the intersection of two planes is line OC
-- d[2] is a direction vector of the line d
-- where d is the line in form {A,u}, the normalized direction vector
local C = R*pt3d.normalize(d[2])
local K = pxy(C) -- projection of C on the plane Oxy
Hiddenlines = true;Hiddenlinestyle = "dashed"
g:Linestyle("dashed")
-- g:DSarc({Pz, Px}, 1)
-- g:DSarc({Pz, Py}, 1)
-- g:DSarc({Px, Py}, 1)
-- g:DSarc({Px, D}, 1)
-- g:DSarc({Pz, A}, 1)
for _, arc in ipairs({{Pz, Px}, {Pz, Py}, {Px, Py}, {Px, D}, {Pz, A}}) do
g:DSarc(arc, 1)
end
-- g:DSseg({O, Pz})
-- g:DSseg({O, Px})
-- g:DSseg({O, Py})
-- g:DSseg({N, K})
-- g:DSseg({M, N})
g:DSpolyline({{Px,O,Pz},{M,N,K},{O,B}})
g:Linestyle("solid"); Hiddenlinestyle = "solid"
g:DSseg({O, A})
g:DSseg({O, D})
g:DSseg({O, C})
g:DSseg({C, K})
g:DSseg({C, M})
g:DSarc({A, B}, 1)
g:DSdots({O,A,D,M,N},{mark_options="teal"})
g:DSstars({Pz, Px, Py}, {color="magenta",fill="magenta", scale=0.75})
g:Dspherical()
g:Dlabel3d(
"$O$", O, {pos="W"},
"$A$", A, {pos="S"},
"$B$", B, {pos="E"},
"$C$", C, {pos="NW"},
"$D$", D, {pos="NE"},
"$K$", K, {pos="W"},
"$M$", M, {pos="N"},
"$N$", N, {pos="NE"}
)
g:Show()
\end{luadraw}
\end{document}


















问 请问如何画四省联考T12的图