texlive[72604] Master/texmf-dist: sunpath (20oct24)
commits+karl at tug.org
commits+karl at tug.org
Sun Oct 20 22:22:20 CEST 2024
Revision: 72604
https://tug.org/svn/texlive?view=revision&revision=72604
Author: karl
Date: 2024-10-20 22:22:19 +0200 (Sun, 20 Oct 2024)
Log Message:
-----------
sunpath (20oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.article.pdf
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.docpart.tex
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.equidistance.pdf
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.equidistance.tex
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.pdf
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.scrartcl.pdf
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.spherical.pdf
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.spherical.tex
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.tex
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.track.pdf
trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.track.tex
trunk/Master/texmf-dist/source/latex/sunpath/sunpath.dtx
trunk/Master/texmf-dist/tex/latex/sunpath/sunpath.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/sunpath/releasenote.txt
Added: trunk/Master/texmf-dist/doc/latex/sunpath/releasenote.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sunpath/releasenote.txt (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/sunpath/releasenote.txt 2024-10-20 20:22:19 UTC (rev 72604)
@@ -0,0 +1,2 @@
+* [breaking change] Rename prefix draw to sp in exposed command
+* [intern] let build.lua also check release date
Property changes on: trunk/Master/texmf-dist/doc/latex/sunpath/releasenote.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.article.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.docpart.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.docpart.tex 2024-10-20 06:53:48 UTC (rev 72603)
+++ trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.docpart.tex 2024-10-20 20:22:19 UTC (rev 72604)
@@ -48,17 +48,9 @@
\begin{figure}[H]
\centering
\begin{tikzpicture}[spradius=3]
-\drawcrosshair;
-\drawaltitudecircle{{0}}
-%\drawazimuthline{{0,10,...,360}}{85}{70}
-%\drawazimuthline{{0,5,...,360}}{80}{0}
-
-%\drawazimuthtick
-
-\drawgeodirection
-%\drawaltitudelabel{{10,20,...,80,85}}
-%\drawazimuthlabel{{0,15,...,350}} ;
-
+\spcrosshair
+\spaltitudecircle{{0}}
+\spgeodirection[0pt]
\path[draw=red,fill=red](sunpath cs:azi=110,alt=66) circle[radius=2pt] ;
\end{tikzpicture}
\caption{Projection of the sun on the horizon plane}
@@ -65,6 +57,7 @@
\label{fig:sun-projection}
\end{figure}
+
\subsection{Draw a Sun path chart}
Figure~\ref{fig:sun-projection} is a very rudimentary sun path chart.
@@ -76,16 +69,16 @@
\begin{figure}[H]
\centering
\begin{tikzpicture}
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spazimuthtick
-\drawgeodirection
-\drawaltitudelabel{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}} ;
+\spgeodirection
+\spaltitudelabel{{10,20,...,80,85}}
+\spazimuthlabel{{0,15,...,350}}
\path[draw=red,fill=red](sunpath cs:azi=110,alt=66) circle[radius=2pt] node[below] {{9:30}};
\end{tikzpicture}
@@ -95,6 +88,8 @@
\subsubsection{Outlines}
+User has to place \verb:\usepackage{sunpath}: in the preamble part of the document.
+
The chart is a \TikZ-picture, so we need a \texttt{tikzpicture}-environment.
We can also customize the distance from the centre of the chart to the horizon line by setup the option \texttt{spradius}.
By default it is 5.5 in PGF xy coordinate.
@@ -106,23 +101,23 @@
\end{tikzpicture}
\end{verbatim}
-We also need the crosshair, the horizon line --in this chart it is a circle--,
+We also need the crosshair, the horizon line --in this type of sun path chart it is a circle--,
the fours geographic direction.
This can be done by adding more commands into the \texttt{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0}}
-\drawgeodirection
+\spcrosshair
+\spaltitudecircle{{0}}
+\spgeodirection
\end{tikzpicture}
\end{verbatim}
\marginpar{\texttt{drawcrosshair\\ drawgeodirection\\ drawaltitudecircle}}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0}}
-\drawgeodirection
+\spcrosshair
+\spaltitudecircle{{0}}
+\spgeodirection
\end{tikzpicture}
@@ -136,21 +131,22 @@
\subsubsection{Scalar and labels}
-As the name of the commando says, we can also draw more than the horizon line by adding some values of altitude in the range of the argument of the command \verb|\drawaltitudecircle|.
-For example \verb:\drawaltitudecircle{{0,10,...,80,85}}: draws 10 circles of altitude.
+As the name of the commando says, we can also draw more than the horizon line by adding some values of altitude in the range of the argument of the command \verb|\spaltitudecircle|.
+For example \verb:\spaltitudecircle{{0,10,...,80,85}}: draws 10 circles of altitude.
+\marginpar{\texttt{drawaltitudecircle}}
\begin{verbatim}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawgeodirection
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spgeodirection
\end{tikzpicture}
\end{verbatim}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawgeodirection
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spgeodirection
\end{tikzpicture}
@@ -160,75 +156,75 @@
For example
\begin{itemize}
- \item \verb:\drawazimuthline{{0,10,...,360}}{85}{70}: draws every 10° azimuth from the 85° altitude to to 70° altitude.
- \item \verb:\drawazimuthline{{0,5,...,360}}{80}{0}: draws every 5° azimuth from the 80° altitude to to 0° altitude.
+ \item \verb:\spazimuthline{{0,10,...,360}}{85}{70}: draws every 10° azimuth from the 85° altitude to to 70° altitude.
+ \item \verb:\spazimuthline{{0,5,...,360}}{80}{0}: draws every 5° azimuth from the 80° altitude to to 0° altitude.
\end{itemize}
\begin{verbatim}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
-\drawgeodirection
+\spgeodirection
\end{tikzpicture}
\end{verbatim}
\marginpar{\texttt{drawazimuthline}}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
-\drawgeodirection
+\spgeodirection
\end{tikzpicture}
To draw azimuth ticks outside the horizon line, we can use
-\verb:\drawazimuthtick:.
+\verb:\spazimuthtick:.
This command expects for now no argument.
\begin{verbatim}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
-\drawgeodirection
+\spgeodirection
\end{tikzpicture}
\end{verbatim}
\marginpar{\texttt{drawazimuthtick}}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
-\drawgeodirection
+\spgeodirection
\end{tikzpicture}
To draw labels of azimuth lines and altitude circles in the chart, we can use the commands
-\verb:\drawaltitudelabel{r}: and
+\verb:\spaltitudelabel{r}: and
-\verb:\drawazimuthlabel{r}:.
+\verb:\spazimuthlabel{r}:.
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
-\drawaltitudelabel{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}}
-\drawgeodirection
+\spaltitudelabel{{10,20,...,80,85}}
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
\end{tikzpicture}
That it's, now we have a nice chart, on which we can draw positions of the sun from time to time.
@@ -247,26 +243,26 @@
\begin{verbatim}
% ...
\path[fill=red,draw=red] (sunpath cs:azi=150,alt=35) circle[radius=2pt];
-\drawaltitudelabel[160]{{10,20,...,80,85}}
+\spaltitudelabel{{10,20,...,80,85}}[160]
% ...
\end{verbatim}
\marginpar{\texttt{sunpath cs}}
\begin{tikzpicture}[spradius=6]
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
\path[fill=red,draw=red] (sunpath cs:azi=150,alt=35) circle[radius=2pt];
-\drawaltitudelabel[160]{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}}
-\drawgeodirection
+\spaltitudelabel{{10,20,...,80,85}}[160]
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
\end{tikzpicture}
-The command \verb:\drawaltitudelabel: can also take an optional argument to set altitude label on other azimuth.
+The command \verb:\spaltitudelabel: can also take an optional argument to set altitude label on other azimuth.
This can be useful if the labels cover distract important points on chart.
In this chart it is set to be 160°. So one can easily read the azimuth of the sun on the chart.
@@ -294,11 +290,11 @@
sunpath point/.style={radius=2pt,draw=red},
sunpath node/.style={below,inner sep=0.5pt,outer sep=4.5pt,fill=white}
}
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
\path[sunpath curve]
(sunpath cs:azi=98.968673,alt=-0.208672) circle[sunpath point] node[sunpath node]{ { 07:44 } }
@@ -311,9 +307,9 @@
--(sunpath cs:azi=260.810553,alt=-0.244637) circle[sunpath point] node[sunpath node]{ { 18:53 } }
;
-\drawaltitudelabel{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}}
-\drawgeodirection
+\spaltitudelabel{{10,20,...,80,85}}
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
\end{tikzpicture}
But this chart is not nice.
@@ -327,11 +323,11 @@
sun point/.style={radius=2pt,draw=red,fill=red},
sun label/.style={below,fill=white,outer sep=4pt,text=red},
}
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
\coordinate (P0) at (sunpath cs:azi=98.968673,alt=-0.208672);
\coordinate (P1) at (sunpath cs:azi=102.009695,alt=2.035492);
@@ -359,11 +355,12 @@
\node[sun label,anchor=270-260.810553] at (P7) {18:53};
\path[sun path curve] (P0) to [curve through={ (P1) .. (P2) .. (P3) .. (P4) .. (P5) .. (P6) }] (P7) ;
-\drawaltitudelabel[170]{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}}
-\drawgeodirection
+\spaltitudelabel{{10,20,...,80,85}}[170]
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
\end{tikzpicture}
+\vfill\newpage
The part, which makes the chart nicer, is there:
\begin{verbatim}
@@ -399,4 +396,52 @@
%...
\end{verbatim}
+To set the altitude scale (and also the altitude lines) equidistance, just use the option \verb|altitude mapping=equidistance|.
+The chart above with same data looks like the chart below with this option.
+\marginpar{\texttt{altitude mapping}} \texttt{ = equidistance}
+
+\begin{tikzpicture}[spradius=6,altitude mapping=equidistance]
+\tikzset{
+ sun path curve/.style={draw=red!20,thick},
+ sun point/.style={radius=2pt,draw=red,fill=red},
+ sun label/.style={below,fill=white,outer sep=4pt,text=red},
+}
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
+
+\coordinate (P0) at (sunpath cs:azi=98.968673,alt=-0.208672);
+\coordinate (P1) at (sunpath cs:azi=102.009695,alt=2.035492);
+\coordinate (P2) at (sunpath cs:azi=126.513583,alt=19.499874);
+\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335);
+\coordinate (P4) at (sunpath cs:azi=192.292832,alt=33.425294);
+\coordinate (P5) at (sunpath cs:azi=224.708002,alt=24.034984);
+\coordinate (P6) at (sunpath cs:azi=250.626597,alt=7.619801);
+\coordinate (P7) at (sunpath cs:azi=260.810553,alt=-0.244637);
+\path[sun point] (P0) circle;
+\path[sun point] (P1) circle;
+\path[sun point] (P2) circle;
+\path[sun point] (P3) circle;
+\path[sun point] (P4) circle;
+\path[sun point] (P5) circle;
+\path[sun point] (P6) circle;
+\path[sun point] (P7) circle;
+\node[sun label,anchor=270-98.968673] at (P0) {07:44};
+\node[sun label,anchor=270-102.009695] at (P1) {08:00};
+\node[sun label,anchor=270-126.513583] at (P2) {10:00};
+\node[sun label,anchor=270-156.854847] at (P3) {12:00};
+\node[sun label,anchor=270-192.292832] at (P4) {14:00};
+\node[sun label,anchor=270-224.708002] at (P5) {16:00};
+\node[sun label,anchor=270-250.626597] at (P6) {18:00};
+\node[sun label,anchor=270-260.810553] at (P7) {18:53};
+\path[sun path curve] (P0) to [curve through={ (P1) .. (P2) .. (P3) .. (P4) .. (P5) .. (P6) }] (P7) ;
+
+\spaltitudelabel{{10,20,...,80,85}}[170]
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
+\end{tikzpicture}
+
+
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.equidistance.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.equidistance.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.equidistance.tex 2024-10-20 06:53:48 UTC (rev 72603)
+++ trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.equidistance.tex 2024-10-20 20:22:19 UTC (rev 72604)
@@ -7,19 +7,19 @@
\usepackage{hyperref}
-
+\pagecolor{white}
\begin{document}
-\begin{tikzpicture}[spradius=6,altitude projection=equidistance]
+\begin{tikzpicture}[spradius=6,altitude mapping=equidistance]
\tikzset{
sun path curve/.style={draw=red!20,thick},
sun point/.style={radius=2pt,draw=red,fill=red},
sun label/.style={below,fill=white,outer sep=4pt,text=red},
}
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335);
@@ -28,9 +28,9 @@
\node[sun label,anchor=270-156.854847] at (P3) {12:00};
-\drawaltitudelabel{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}}
-\drawgeodirection
+\spaltitudelabel{{10,20,...,80,85}}
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
\end{tikzpicture}
\end{document}
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.scrartcl.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.spherical.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.spherical.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.spherical.tex 2024-10-20 06:53:48 UTC (rev 72603)
+++ trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.spherical.tex 2024-10-20 20:22:19 UTC (rev 72604)
@@ -7,7 +7,7 @@
\usepackage{hyperref}
-
+\pagecolor{white}
\begin{document}
\begin{tikzpicture}[spradius=6]
\tikzset{
@@ -15,11 +15,11 @@
sun point/.style={radius=2pt,draw=red,fill=red},
sun label/.style={below,fill=white,outer sep=4pt,text=red},
}
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335);
@@ -28,9 +28,9 @@
\node[sun label,anchor=270-156.854847] at (P3) {12:00};
-\drawaltitudelabel{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}}
-\drawgeodirection
+\spaltitudelabel{{10,20,...,80,85}}
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
\end{tikzpicture}
\end{document}
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.tex 2024-10-20 06:53:48 UTC (rev 72603)
+++ trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.tex 2024-10-20 20:22:19 UTC (rev 72604)
@@ -1,7 +1,7 @@
% main document
% separated from dtx, sothat there is no unrelated things in the dtx itselft, but only code and comment for package
-\documentclass[full]{ltxdoc}
+\documentclass{ltxdoc}
\usepackage{fontspec}
\usepackage{luaotfload}
@@ -8,7 +8,9 @@
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{float}
+\usepackage{mathtools}
+
\usepackage{sunpath}
\usetikzlibrary{hobby} % this library let one connect points to curve.
@@ -50,7 +52,7 @@
\input{sunpath.docpart.tex}
-
+\vfill\newpage
% get the document about implementation inside main document
\DocInput{\jobname.dtx}
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.track.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.track.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.track.tex 2024-10-20 06:53:48 UTC (rev 72603)
+++ trunk/Master/texmf-dist/doc/latex/sunpath/sunpath.track.tex 2024-10-20 20:22:19 UTC (rev 72604)
@@ -7,19 +7,20 @@
\usepackage{hyperref}
-
+\pagecolor{white}
\begin{document}
-\begin{tikzpicture}[spradius=6]
+\begin{tikzpicture}[spradius=4]
\tikzset{
sun path curve/.style={draw=red!20,thick},
sun point/.style={radius=2pt,draw=red,fill=red},
- sun label/.style={below,fill=white,outer sep=4pt,text=red},
+ sun label/.style={below,fill=white,outer sep=3pt,inner sep=0pt,text=red},
+ small alt label/.style={altitude label,font=\scriptsize\sffamily}
}
-\drawcrosshair
-\drawaltitudecircle{{0,10,...,80,85}}
-\drawazimuthline{{0,10,...,360}}{85}{70}
-\drawazimuthline{{0,5,...,360}}{80}{0}
-\drawazimuthtick
+\spcrosshair
+\spaltitudecircle{{0,10,...,80,85}}
+\spazimuthline{{0,10,...,360}}{85}{70}
+\spazimuthline{{0,5,...,360}}{80}{0}
+\spazimuthtick
\coordinate (P0) at (sunpath cs:azi=98.968673,alt=-0.208672);
\coordinate (P1) at (sunpath cs:azi=102.009695,alt=2.035492);
@@ -47,9 +48,9 @@
\node[sun label,anchor=270-260.810553] at (P7) {18:53};
\path[sun path curve] (P0) to [curve through={ (P1) .. (P2) .. (P3) .. (P4) .. (P5) .. (P6) }] (P7) ;
-\drawaltitudelabel[175]{{10,20,...,80,85}}
-\drawazimuthlabel{{0,15,...,350}}
-\drawgeodirection
+\spaltitudelabel{{10,30,40,...,80,85}}[175][small alt label]
+\spazimuthlabel{{0,15,...,350}}
+\spgeodirection
\end{tikzpicture}
\end{document}
Modified: trunk/Master/texmf-dist/source/latex/sunpath/sunpath.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/sunpath/sunpath.dtx 2024-10-20 06:53:48 UTC (rev 72603)
+++ trunk/Master/texmf-dist/source/latex/sunpath/sunpath.dtx 2024-10-20 20:22:19 UTC (rev 72604)
@@ -20,12 +20,26 @@
%
% -----------------------------------------------------------------------
% \fi
+%
+% ^^A To get version of latex run:
+% ^^A `latex '\typeout{\fmtversion}\stop' | grep LaTeX2e`
%
% \iffalse
-%<package>\NeedsTeXFormat{LaTeX2e}[2018/12/01]
-%<package>\ProvidesPackage{sunpath}[2024/10/16 v0.2-Alpha Draw Sun Path]
+%<package>\NeedsTeXFormat{LaTeX2e}[2022/11/01]
+%<package>\ProvidesPackage{sunpath}[2024/10/20 v0.5 Draw Sun Path]
% \fi
+% \changes{v0.5}
+% {2024/10/20}
+% {replace prefix "draw" in exposed commands by "sp"}
+% \changes{v0.4-Alpha}
+% {2024/10/20}
+% {rename option altitude projection to altitude mapping}
+% \changes{v0.3-Alpha}
+% {2024/10/16}
+% {add style option in exposed commands;
+% let build.lua read version information from sunpath.dtx file}
+%
% \changes{v0.2-Alpha}
% {2024/10/16}
% {Small fixes in README.md and document}
@@ -53,18 +67,21 @@
% \subsection{\texttt{tikz}-Options for the new coordinate system}
-% Setup options for tikzpicture environment.
+% Setup options for \texttt{tikzpicture} environment.
+%
% \DescribeMacro{spradius} The radius of the 0° Altitude circle, default 5.5.
% This value can be accessed via macro \verb:\spradius:.
%
-% \DescribeMacro{altitude projection}
-% How the altitude of the sun is "projected" on the sunpath diagram.
+% \DescribeMacro{altitude mapping}
+% How the altitude of the sun is mapped on the sunpath diagram.
+% This mapping is a function $f(\theta): [-90,90] \to [0, r]$, where $r$ is saved in \verb|\spradius|.
+%
% Valid values are \texttt{spherical} and \texttt{equidistance}.
% Its default value is \texttt{spherical}.
%
-% This value can be accessed via macro \verb:\sprojection:.
+% This value can be accessed via macro \verb:\altmapping:.
-% These options can be used like
+% These options can be used like:
%
% \begin{verbatim}
% \begin{tikzpicture}[spradius=6,altitude projection=equidistance]
@@ -76,8 +93,8 @@
\pgfkeys{/tikz/.cd,
spradius/.store in=\spradius,
spradius=5.5,
- altitude projection/.store in = \spprojection,
- altitude projection=spherical
+ altitude mapping/.store in = \altmapping,
+ altitude mapping=spherical
}
% \end{macrocode}
%
@@ -106,7 +123,7 @@
%
% \DescribeMacro{equidistance}
% maps an altitude angle $\theta$ to the altitude radius on the diagram with the function
-% \[e (\theta) = r - r\cdot \frac{\theta}{90}. \]
+% \[e (\theta) = r - r \cdot \frac{\left\lvert \theta \right\rvert}{90}. \]
%
% \DescribeMacro{altradius}
% this function is used in the coordinate system \texttt{sunpath} to determinate the altitude
@@ -121,8 +138,8 @@
\tikzset{
declare function = {
spherical(\alt) = \spradius * cos(\alt);
- equidistance(\alt) = \spradius - \spradius*\alt/90;
- altradius(\alt) = \spprojection(\alt);
+ equidistance(\alt) = \spradius - \spradius*abs(\alt)/90;
+ altradius(\alt) = \altmapping(\alt);
aziangle(\x) = 90 - \x;
}
}
@@ -150,6 +167,20 @@
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Setup optical options for sunpath diagram}
+% These are pre-defined \TikZ{} style for components of the chart. They can be easily changed by using \cmd{\tikzset}.
+%
+% \DescribeMacro{sunpath grid} \tikz{\draw [sunpath grid] (0,0) -- (1,0);} style for azimuth lines and altitude circles
+%
+% \DescribeMacro{sunpath tick} \tikz{\draw [sunpath tick] (0,0) -- (4pt,0);} style for ticks around the horizon line
+%
+% \DescribeMacro{sunpath minor tick} \tikz{\draw [sunpath minor tick] (0,0) -- (4pt,0);} style for minor ticks around horizon line
+%
+% \DescribeMacro{altitude label} \tikz{\node[altitude label] {80};}
+%
+% \DescribeMacro{azimuth label} \tikz{\node[altitude label] {350};} style for text label of altitude circle respective azimuth line
+%
+% \DescribeMacro{direction label} \tikz{\node[direction label] {N E S W}; } style for text label of four directions
+%
% \begin{macrocode}
\tikzset{
sunpath grid/.style={help lines,color=blue!45!white!80},
@@ -165,33 +196,60 @@
minimum width={width("360")+2pt},
inner sep=0.5pt
},
+ direction label/.style={
+ font=\normalsize\rmfamily
+ }
}
% \end{macrocode}
+
+
+% \subsection{Expose some commands for end-user}
+
+% \DescribeMacro{\spcrosshair} \oarg{style}
%
+% Draws a thin line from North to South and a thin line from East to West.
+% Default value of \oarg{style} is \texttt{sunpath grid}.
%
-% \subsection{Expose some commands for end-user}
% \begin{macrocode}
-\NewDocumentCommand\drawcrosshair{}{
- \draw[sunpath grid] (-\spradius,0) -- (\spradius,0);
- \draw[sunpath grid] (0,-\spradius) -- (0,\spradius);
+\NewDocumentCommand\spcrosshair{O{sunpath grid}}{
+ \draw[#1] (-\spradius,0) -- (\spradius,0);
+ \draw[#1] (0,-\spradius) -- (0,\spradius);
}
% \end{macrocode}
+
+
+
+
+% \DescribeMacro{\spgeodirection} \oarg{offset}\oarg{style}
%
+%
+% Puts four geographic directions North, East, South, West around the horinzon line.
+% \oarg{offset} is the distance from horizon to the \TikZ{} node of the directions.
+% Its default value is 22pt.
+% Set it to zero causes that the directions are set very near to the horizon line.
% \begin{macrocode}
-\NewDocumentCommand\drawgeodirection{}{
+\NewDocumentCommand\spgeodirection{O{22pt} O{direction label}}{
\foreach \dname / \dgrad in {N/0, E/90, S/180, W/270}{
\tikzmath{
\polarangle = aziangle(\dgrad);
}
- \coordinate (D) at (\polarangle:\spradius cm + 22pt);
- \node[anchor=270-\dgrad] at (D) {\dname};
- };
+ \coordinate (D) at (\polarangle:\spradius cm + #1);
+ \node[#2,anchor=270-\dgrad] at (D) {\dname};
+ }
}
% \end{macrocode}
+
+
+
+
+% \DescribeMacro{\spaltitudecircle} \marg{range}\oarg{style}
%
-%
+% Draws altitude circle given by \marg{range}.
+% The argument \marg{range} must be a valid \TikZ-range, which can be used in \cmd{\foreach}.
+% For example \verb|{{10,20,...,80,85}}|.
+% The argument \oarg{style} define the style of altitude circles, default is \texttt{sunpath~grid}.
% \begin{macrocode}
-\NewDocumentCommand\drawaltitudecircle{m}{
+\NewDocumentCommand\spaltitudecircle{m O{sunpath grid}}{
\foreach \altitude in #1 {
\coordinate (A) at (sunpath cs:azi=0,alt=\altitude) ;
\path[draw,sunpath grid] (0,0) circle[radius=altradius(\altitude)];
@@ -198,47 +256,75 @@
}
}
% \end{macrocode}
+
+
+
+
+% \DescribeMacro{\spaltitudelabel} \marg{range}\oarg{azimuth}\oarg{style}
+%
+% Draws the labels of altitude circles given by \marg{range}.
+% Range must be an in \TikZ{} valid numeric range which can be used in \cmd{\foreach}.
+% For example \verb|{{10,20,...,80}}|
+% The labels are placed along the azimuth \oarg{azimuth} (default 135)
+% and typeset with style \oarg{style} (default \texttt{altitude label}).
%
-%
% \begin{macrocode}
-\NewDocumentCommand\drawaltitudelabel{O{135}m}{
- \foreach \altitude in #2 {
- \coordinate (A) at (sunpath cs:azi=#1,alt=\altitude) ;
- \node [anchor=east,altitude label] at (A) {\altitude};
+\NewDocumentCommand\spaltitudelabel{m O{135} O{altitude label}}{
+ \foreach \altitude in #1 {
+ \coordinate (A) at (sunpath cs:azi=#2,alt=\altitude) ;
+ \node [anchor=east,#3] at (A) {\altitude};
}
}
% \end{macrocode}
+
+
+
+
+% \DescribeMacro{\spazimuthlabel} \marg{range}\oarg{style}
%
-%
% \begin{macrocode}
-\NewDocumentCommand\drawazimuthlabel{m}{
+\NewDocumentCommand\spazimuthlabel{m O{azimuth label}}{
\foreach \azimuth in #1 {
\tikzmath{
\polarangle = aziangle(\azimuth);
}
\coordinate (D) at (\polarangle:\spradius cm + 13pt);
- \node[azimuth label] at (D) {\azimuth};
+ \node[#2] at (D) {\azimuth};
}
}
% \end{macrocode}
+
+
+
+
+% \DescribeMacro{\spazimuthline} \marg{range}\marg{start~alt}\marg{end~alt}
%
-%
% \begin{macrocode}
-\NewDocumentCommand\drawazimuthline{m m m}{
+\NewDocumentCommand\spazimuthline{m m m}{
\foreach \azimuth in #1{
- \draw[sunpath grid] (sunpath cs:azi=\azimuth,alt={#2}) -- (sunpath cs:azi=\azimuth,alt={#3});
+ \draw[sunpath grid]
+ (sunpath cs:azi=\azimuth,alt={#2}) -- (sunpath cs:azi=\azimuth,alt={#3});
}
}
% \end{macrocode}
+
+
+
+
+% \DescribeMacro{\spazimuthtick} \oarg{major}\oarg{minor}\oarg{mid}
+%
+% Draws ticks along and outside the horizon circle. The optional arguments \oarg{major},
+% \oarg{minor} and \oarg{mid} are the length of major ticks (every 10° from Zero),
+% minor ticks (every 1°, from 1°) and the length of the middle ticks (every 30°, from 15°).
+% Their default values are 6pt, 2.5pt and 5pt.
%
-%
% \begin{macrocode}
-\NewDocumentCommand\drawazimuthtick{}{
+\NewDocumentCommand\spazimuthtick{O{6pt} O{2.5pt} O{5pt}}{
\foreach \azimuth in {10,20,...,360}{
\tikzmath{
\pa = aziangle(\azimuth);
}
- \path[sunpath tick] (\pa:\spradius) -- (\pa:{\spradius cm+6pt});
+ \path[sunpath tick] (\pa:\spradius) -- (\pa:{\spradius cm + #1});
}
\foreach \azimuth in {1,2,...,360}{
@@ -245,19 +331,21 @@
\tikzmath{
\pa = aziangle(\azimuth);
}
- \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm+2.5pt});
+ \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm + #2});
}
- \foreach \azimuth in {15,30,...,360}{
+ \foreach \azimuth in {15,45,...,345}{
\tikzmath{
\pa = aziangle(\azimuth);
}
- \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm+5pt});
+ \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm + #3});
}
}
% \end{macrocode}
-%
-%
+
+
+
+
%%%%%%%%%%%%%%
\endinput
%%%%%%%%%%%%%%
Modified: trunk/Master/texmf-dist/tex/latex/sunpath/sunpath.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/sunpath/sunpath.sty 2024-10-20 06:53:48 UTC (rev 72603)
+++ trunk/Master/texmf-dist/tex/latex/sunpath/sunpath.sty 2024-10-20 20:22:19 UTC (rev 72604)
@@ -6,8 +6,8 @@
%%
%% sunpath.dtx (with options: `package')
%%
-\NeedsTeXFormat{LaTeX2e}[2018/12/01]
-\ProvidesPackage{sunpath}[2024/10/16 v0.2-Alpha Draw Sun Path]
+\NeedsTeXFormat{LaTeX2e}[2022/11/01]
+\ProvidesPackage{sunpath}[2024/10/20 v0.5 Draw Sun Path]
\RequirePackage{expl3}
@@ -18,8 +18,8 @@
\pgfkeys{/tikz/.cd,
spradius/.store in=\spradius,
spradius=5.5,
- altitude projection/.store in = \spprojection,
- altitude projection=spherical
+ altitude mapping/.store in = \altmapping,
+ altitude mapping=spherical
}
\makeatletter
@@ -32,8 +32,8 @@
\tikzset{
declare function = {
spherical(\alt) = \spradius * cos(\alt);
- equidistance(\alt) = \spradius - \spradius*\alt/90;
- altradius(\alt) = \spprojection(\alt);
+ equidistance(\alt) = \spradius - \spradius*abs(\alt)/90;
+ altradius(\alt) = \altmapping(\alt);
aziangle(\x) = 90 - \x;
}
}
@@ -65,52 +65,64 @@
minimum width={width("360")+2pt},
inner sep=0.5pt
},
+ direction label/.style={
+ font=\normalsize\rmfamily
+ }
}
-\NewDocumentCommand\drawcrosshair{}{
- \draw[sunpath grid] (-\spradius,0) -- (\spradius,0);
- \draw[sunpath grid] (0,-\spradius) -- (0,\spradius);
+
+
+\NewDocumentCommand\spcrosshair{O{sunpath grid}}{
+ \draw[#1] (-\spradius,0) -- (\spradius,0);
+ \draw[#1] (0,-\spradius) -- (0,\spradius);
}
-\NewDocumentCommand\drawgeodirection{}{
+
+\NewDocumentCommand\spgeodirection{O{22pt} O{direction label}}{
\foreach \dname / \dgrad in {N/0, E/90, S/180, W/270}{
\tikzmath{
\polarangle = aziangle(\dgrad);
}
- \coordinate (D) at (\polarangle:\spradius cm + 22pt);
- \node[anchor=270-\dgrad] at (D) {\dname};
- };
+ \coordinate (D) at (\polarangle:\spradius cm + #1);
+ \node[#2,anchor=270-\dgrad] at (D) {\dname};
+ }
}
-\NewDocumentCommand\drawaltitudecircle{m}{
+
+\NewDocumentCommand\spaltitudecircle{m O{sunpath grid}}{
\foreach \altitude in #1 {
\coordinate (A) at (sunpath cs:azi=0,alt=\altitude) ;
\path[draw,sunpath grid] (0,0) circle[radius=altradius(\altitude)];
}
}
-\NewDocumentCommand\drawaltitudelabel{O{135}m}{
- \foreach \altitude in #2 {
- \coordinate (A) at (sunpath cs:azi=#1,alt=\altitude) ;
- \node [anchor=east,altitude label] at (A) {\altitude};
+
+\NewDocumentCommand\spaltitudelabel{m O{135} O{altitude label}}{
+ \foreach \altitude in #1 {
+ \coordinate (A) at (sunpath cs:azi=#2,alt=\altitude) ;
+ \node [anchor=east,#3] at (A) {\altitude};
}
}
-\NewDocumentCommand\drawazimuthlabel{m}{
+
+\NewDocumentCommand\spazimuthlabel{m O{azimuth label}}{
\foreach \azimuth in #1 {
\tikzmath{
\polarangle = aziangle(\azimuth);
}
\coordinate (D) at (\polarangle:\spradius cm + 13pt);
- \node[azimuth label] at (D) {\azimuth};
+ \node[#2] at (D) {\azimuth};
}
}
-\NewDocumentCommand\drawazimuthline{m m m}{
+
+\NewDocumentCommand\spazimuthline{m m m}{
\foreach \azimuth in #1{
- \draw[sunpath grid] (sunpath cs:azi=\azimuth,alt={#2}) -- (sunpath cs:azi=\azimuth,alt={#3});
+ \draw[sunpath grid]
+ (sunpath cs:azi=\azimuth,alt={#2}) -- (sunpath cs:azi=\azimuth,alt={#3});
}
}
-\NewDocumentCommand\drawazimuthtick{}{
+
+\NewDocumentCommand\spazimuthtick{O{6pt} O{2.5pt} O{5pt}}{
\foreach \azimuth in {10,20,...,360}{
\tikzmath{
\pa = aziangle(\azimuth);
}
- \path[sunpath tick] (\pa:\spradius) -- (\pa:{\spradius cm+6pt});
+ \path[sunpath tick] (\pa:\spradius) -- (\pa:{\spradius cm + #1});
}
\foreach \azimuth in {1,2,...,360}{
@@ -117,16 +129,17 @@
\tikzmath{
\pa = aziangle(\azimuth);
}
- \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm+2.5pt});
+ \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm + #2});
}
- \foreach \azimuth in {15,30,...,360}{
+ \foreach \azimuth in {15,45,...,345}{
\tikzmath{
\pa = aziangle(\azimuth);
}
- \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm+5pt});
+ \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm + #3});
}
}
+
%%%%%%%%%%%%%%
%% Copyright (C) 2024 by
%% Hong-Phuc Bui
More information about the tex-live-commits
mailing list.