\DocumentMetadata{}
\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small,
    headinclude=false,footinclude=false,twoside,english]{scrartcl}

\usepackage[includemp,includeheadfoot,
  lmargin=1cm,tmargin=1cm,bmargin=1.5cm,rmargin=0.25cm]{geometry}

\usepackage{iftex}
\ifluatex
  \usepackage{libertinus}
  \usepackage[Scale=0.88,FakeStretch=0.85]{juliamono}
\else
  \usepackage{fontenc,libertinus}
  \usepackage[scaled]{beramono}
\fi

\usepackage[style=authoryear]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{pst-eqhz}
\usepackage{pst-calculate}
\usepackage{amsmath,xurl}
\usepackage[colorlinks=true]{hyperref}

\raggedbottom
%\parindent=0pt

\def\Lcs#1{\texttt{\textbackslash#1}}
%\def\parencite#1{}

\title{\texttt{pst-eqhz} -- Superimposed Horizontal and Equatorial Coordinate Systems}
\author{Manuel Luque\thanks{manuel.lque27@gmail.com} \and 
	Herbert Voß\thanks{hvoss@tug.org@}}
\date{\today}

\begin{document}

\maketitle

\section{The Problem}
The objective was to create a command enabling the superposition of the 
horizontal and equatorial coordinate systems, as previously 
demonstrated by Hyomin Kim.~\parencite{kim}.
%https://web.njit.edu/~hmkim/phys322/Phy_322_Basics_2019Spring.pdf

Determine the intersections of the circles and meridians with a plane 
passing through O. This plane will represent the observer's plane. 
It will be defined by the normal vector $\vec{n}$. If $\lambda$ is the 
latitude of the location:


\begin{align}
\overrightarrow{n}
\begin{pmatrix}
  0 \\
  \cos\lambda \\
  \sin\lambda
 \end{pmatrix}
\end{align}

L'équation du plan s'écrira :
\begin{align}
y\cos\lambda+z\sin\lambda=0
\end{align}


\begin{center}
\begin{pspicture}(-3,-3)(3,4)%%
\psline[linestyle=dashed](1;30)(2.5;30)
\psline[arrowinset=0.1,arrowsize=0.2,linecolor=red]{->}(1;30)
\psline[linecolor=green](-2.5;120)(2.5;120)
\psline(-2.5,0)(2.5,0)
\pscircle{2.5}
\psarc{->}(0,0){1.5}{0}{30}
\uput[15](1.5;15){$\lambda$}
\rput(2.5;30){\psline(-2.5;120)(2.5;120)}
\psline[arrowinset=0.1,arrowsize=0.2]{->}(0,-3)(0,3)
\end{pspicture}
\begin{pspicture}(-3,-3)(3,4)%%
\rput{60}{%
\psline[linestyle=dashed](1;30)(2.5;30)
\psline[arrowinset=0.1,arrowsize=0.2,linecolor=red]{->}(1;30)
\psline[linecolor=green](-2.5;120)(2.5;120)
\psline(-2.5,0)(2.5,0)
\pscircle{2.5}
\psarc{->}(0,0){1.5}{30}{90}
\rput{-30}(1.75;60){$\frac{\pi}{2}-\lambda$}
%\rput(2.5;30){(-2.5;120)(2.5;120)}
\psline[arrowinset=0.1,arrowsize=0.2]{->}(0,-3)(0,3)}
\end{pspicture}
\end{center}

On the globe of unit radius, we locate a point located on the meridian 
$\theta$ and the parallel $\varphi$ by:

\[
\left\{
\begin{array}[m]{l} 
x=\cos\theta\cos\varphi\\ 
y=\sin\theta\cos\varphi\\ 
z=\sin\varphi
\end{array}
\right.
\]

Cutting a meridian defined by $\theta=\theta_0$, let's determine $\phi$.

\[
\sin\theta_0\cos\varphi\cos\lambda+\sin\varphi\sin\lambda=0 \Longrightarrow \tan\varphi=-\frac{\sin\theta_0}{\tan\lambda}
\]

Cutting a parallel defined by $\varphi=\varphi_0$, we determine $\theta$.

\[
\sin\theta\cos\varphi_0\cos\lambda+\sin\varphi_0\sin\lambda=0 
	\Longrightarrow \sin\theta=-\tan\varphi_0\tan\lambda
\]


The entire assembly is then rotated by an angle of $\frac{\pi}{2}-\lambda$ —that is, 
by the colatitude of the location—in order to position the observer's plane horizontally.



\section{The \Lcs{psEquatorialHorizontal} command}

The optional parameters, along with their default values, are as follows:
\begin{enumerate}
\item \texttt{[dAngle=15]}: the angle between two meridians or two parallels; 
\item \texttt{[colatitude=45]}: the colatitude of the observation site. 
	This value should be chosen between 10 and 80, and—if possible—should be a 
	multiple of \texttt{[dAngle]} to avoid gaps in the continuity of the meridians and parallels; 
\item \texttt{[RA=45]}: the Right Ascension of the depicted star; 
\item \texttt{[Dec=45]}: the Declination of the star; 
\item The Boolean \texttt{[names=true]}: used to label the various features of the diagram (e.g., the celestial equator, etc.). Indeed, depending on the chosen parameters, it can be difficult to predict the ideal placement for the label of any given diagram element; by setting \texttt{[names=false]} and using the \texttt{[showgrid]} option, it becomes easy to manually draw arrows and position the labels correctly.
\end{enumerate}

The character depicted is Basile, the apprentice of Leonardo (da Vinci), 
from the comic series "'Léonard"' by Turk and Bob de Groot.

%\begin{exampleM}[]{Example}
\begin{pspicture}(-8.5,-3)(10.5,9.5)%
\psset{viewpoint=1000 30 20 rtp2xyz,Decran=1000}
\psEquatorialHorizontal[unit=1.2]
\end{pspicture}
%\end{exampleM}

\begin{verbatim}
\psset{viewpoint=1000 30 20 rtp2xyz,Decran=1000}%
\begin{pspicture}(-8.5,-3)(10.5,9.5)%
\psEquatorialHorizontal[unit=1.2]
\end{pspicture}
\end{verbatim}

We will not change the radius of the vault (r=5), but we can modify the size of the diagram using [unit=...],
as in the drawing above.

Running the example with \verb|lualatex| is only possible with setting the optional 
argument \verb|image=false|:

%\begin{exampleM}[]{Example}
\begin{pspicture}(-8.5,-3)(10.5,9.5)%
\psset{viewpoint=1000 30 20 rtp2xyz,Decran=1000}
\psEquatorialHorizontal[unit=1.2,image=false]
\end{pspicture}
%\end{exampleM}

\begin{verbatim}
\psset{viewpoint=1000 30 20 rtp2xyz,Decran=1000}%
\begin{pspicture}(-8.5,-3)(10.5,9.5)%
\psEquatorialHorizontal[unit=1.2,image=false]
\end{pspicture}
\end{verbatim}

\section{Other Examples}
We may change the point of view, but we will maintain a significant distance 
from it and position the screen at the same distance.



\begin{center}
\psset[pst-solides3d]{viewpoint=1000 45 45 rtp2xyz,Decran=1000}%
\begin{pspicture}(-6,-4)(7.5,6)
\psEquatorialHorizontal[colatitude=60,names=false]
\end{pspicture}
\end{center}


\begin{verbatim}
\psset{viewpoint=1000 45 45 rtp2xyz,Decran=1000}%
\begin{pspicture}(-7.5,-4)(7.5,9)%%
\psEquatorialHorizontal[colatitude=60,names=false]
\end{pspicture}
\end{verbatim}

\begin{center}
\psset{viewpoint=1000 20 40 rtp2xyz,Decran=1000}%
\begin{pspicture}(-6,-4)(7,6)
\psEquatorialHorizontal[colatitude=10,dAngle=10,RA=50,Dec=80,names=false]
\end{pspicture}
\end{center}

\begin{verbatim}
\psset{viewpoint=1000 20 40 rtp2xyz,Decran=1000}%
\begin{pspicture}(-6,-4)(7,6)
\psEquatorialHorizontal[colatitude=10,dAngle=10,RA=50,Dec=80,names=false]
\end{pspicture}
\end{verbatim}




\printbibliography

\end{document} 
