Discussion:
Automatische Vollmondberechnung
(zu alt für eine Antwort)
Heiner Richter
2023-11-12 08:21:48 UTC
Permalink
Liebe Fachleute,

gibt es so eine Berechnung, hier Netzfund für Excel-Berechnung, ob ein
Datum A1 Vollmond ist,

=WENN((REST(A1-105,6213922;29,530588)+1)>29,530588;”Vollmond”;”kein
Vollmond”)

auch schon für LaTeX bzw. in pgf/tikz calendar Library integriert?

Viele Grüße

Heiner
Stefan Ram
2023-11-12 10:28:40 UTC
Permalink
Post by Heiner Richter
gibt es so eine Berechnung, hier Netzfund für Excel-Berechnung, ob ein
Datum A1 Vollmond ist,
Siehe auch "moon.tex", beschrieben in "Using TeX to make
Agendas and Calendars with Astronomical Events", Jordi Saludes,
TUGboat, Jahrgang 14 (1993), No. 1, Seite 40.
Stefan Ram
2023-11-12 10:51:02 UTC
Permalink
Post by Stefan Ram
Post by Heiner Richter
gibt es so eine Berechnung, hier Netzfund für Excel-Berechnung, ob ein
Datum A1 Vollmond ist,
Siehe auch "moon.tex", beschrieben in "Using TeX to make
Agendas and Calendars with Astronomical Events", Jordi Saludes,
TUGboat, Jahrgang 14 (1993), No. 1, Seite 40.
(Einige Dateien namens "dayofweek.sty" enthalten möglicherweise
auch noch etwas zur Mondphase.)
Heiner Richter
2023-11-12 11:37:04 UTC
Permalink
Post by Heiner Richter
Liebe Fachleute,
gibt es so eine Berechnung, hier Netzfund für Excel-Berechnung, ob ein
Datum A1 Vollmond ist,
=WENN((REST(A1-105,6213922;29,530588)+1)>29,530588;”Vollmond”;”kein
Vollmond”)
auch schon für LaTeX bzw. in pgf/tikz calendar Library integriert?
Viele Grüße
Heiner
https://www.latex4technics.com/?note=hcg

hier habe ich etwas dazu gefunden.
Heiner Richter
2023-11-14 07:12:57 UTC
Permalink
Post by Heiner Richter
Post by Heiner Richter
Liebe Fachleute,
gibt es so eine Berechnung, hier Netzfund für Excel-Berechnung, ob ein
Datum A1 Vollmond ist,
=WENN((REST(A1-105,6213922;29,530588)+1)>29,530588;”Vollmond”;”kein
Vollmond”)
auch schon für LaTeX bzw. in pgf/tikz calendar Library integriert?
Viele Grüße
Heiner
https://www.latex4technics.com/?note=hcg
hier habe ich etwas dazu gefunden.
Versteht jemand, was an der Definition der Berechnung falsch ist, denn
die Symbole für die 14 Tage nach Neumond erscheinen spiegelverkehrt:

%%%%%%%%%%%%%%%%%Minimalbeispiel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calendar,fpu}

\tikzset{
moon colour/.style={
moon fill/.style={
fill=#1
}
},
sky colour/.style={
sky draw/.style={
draw=#1
},
sky fill/.style={
fill=#1
}
},
southern hemisphere/.style={
rotate=180
}
}

\makeatletter
\pgfcalendardatetojulian{2023-11-13}{\***@pgf@counta} % 2010-01-15 07:11
UTC -- http://aa.usno.navy.mil/cgi-bin/aa_moonphases.pl?year=2010&ZZZ=END
\def\synodicmonth{29.530588853}
\newcommand{\moon}[2][]{%
\edef\checkfordate{\noexpand\in@{-}{#2}}%
\checkfordate%
\ifin@%
\pgfcalendardatetojulian{#2}{\***@pgf@countb}%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro\dayssincenewmoon{\the\***@pgf@countb-\the\***@pgf@counta-(7/24+11/(24*60))}%
\pgfmathsetmacro\lunarage{mod(\dayssincenewmoon,\synodicmonth)}
\pgfkeys{/pgf/fpu=false}%%
\else%
\def\lunarage{#2}%
\fi%
\pgfmathsetmacro\leftside{ifthenelse(\lunarage<=\synodicmonth/2,cos(360*(\lunarage/\synodicmonth)),1)}%
\pgfmathsetmacro\rightside{ifthenelse(\lunarage<=\synodicmonth/2,-1,-cos(360*(\lunarage/\synodicmonth))}%
\tikz [moon colour=white,sky colour=black,#1]{
\draw [moon fill, sky draw] (0,0) circle [radius=1ex];
\draw [sky draw, sky fill] (0,1ex)
arc (90:-90:\rightside ex and 1ex)
arc (-90:90:\leftside ex and 1ex)
-- cycle;
}%
}
\newcommand{\newmoon}{\moon{0}}
\newcommand{\waxingcrescent}{\moon{\synodicmonth/8}}
\newcommand{\firstquartermoon}{\moon{2*\synodicmonth/8}}
\newcommand{\waxinggibbous}{\moon{3*\synodicmonth/8}}
\newcommand{\fullmoon}{\moon{4*\synodicmonth/8}}
\newcommand{\waninggibbous}{\moon{5*\synodicmonth/8}}
\newcommand{\thirdquartermoon}{\moon{6*\synodicmonth/8}}
\newcommand{\waningcrescent}{\moon{7*\synodicmonth/8}}
\begin{document}\noindent\raggedleft%


%%%%leftside, Tage nach Neumond erscheinen spiegelverkehrt %%%%%

\foreach \d in {0,1,...,30}{%
\d: \moon{\year-11-\d} \ }

%%%%%%\waxingcrescent\waningcrescent sind demgegenüber korrekt %%%%%%
\waxingcrescent\waningcrescent
\end{document}
Dr Eberhard W Lisse
2023-11-15 20:37:32 UTC
Permalink
Wäre das nicht etwas für Lua(TeX)?

ChatGPT bietet soetwas an:

function getFullMoonDate(year)
local k = math.floor((year - 1900) * 12.3685)
local t = k / 1236.85
local a = math.rad(359.2242 + 29.105356 * k)
local b = math.rad(306.0253 + 385.816918 * k)
local c = math.rad(21.2964 + 390.670506 * k)

local jd = 2415020.75933 + 29.53058868 * k + 0.0001178 * math.sin(a) -
0.000000155 * math.sin(b) + 0.00033 * math.sin(c)

local deltaT = 8.0 / 60.0 -- Adjust for Delta T (difference between
Earth's time and Dynamical time)

return os.date("!%Y-%m-%d", jd + deltaT)
end

-- Example usage:
local year = 2023
local fullMoonDate = getFullMoonDate(year)
print("Full Moon in " .. year .. ": " .. fullMoonDate)

mfg, el
Post by Heiner Richter
Liebe Fachleute,
gibt es so eine Berechnung, hier Netzfund für Excel-Berechnung, ob ein
Datum A1 Vollmond ist,
=WENN((REST(A1-105,6213922;29,530588)+1)>29,530588;”Vollmond”;”kein
Vollmond”)
auch schon für LaTeX bzw. in pgf/tikz calendar Library integriert?
Viele Grüße
Heiner
Heiner Richter
2023-11-16 06:49:54 UTC
Permalink
Post by Dr Eberhard W Lisse
Wäre das nicht etwas für Lua(TeX)?
...
Danke für die Antwort, die mich auf die Idee brachte, zum ersten Mal
ChatGPT zu befragen, und tatsächlich erhielt ich korrigierten Code.

%%%%%%%%%%%%% Funktionierendes Minimalbeispiel %%%%%%%%%%%%%%%%
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calendar,fpu,calc}

\newcommand\mond[4] % center, radius, color, rotation (-180,...,180),
{%
\ifnum #4 > 0
\pgfmathsetmacro\lb{ #2} % left arc, horizontal axis
\pgfmathsetmacro\rb{ #2*(90-#4)/90} % right arc, horizontal axis
\else
\pgfmathsetmacro\lb{-#2*(90+#4)/90} % left arc, horizontal axis
\pgfmathsetmacro\rb{-#2} % right arc, horizontal axis
\fi
\draw[thick,#3,fill=white] #1 circle (#2);
\fill[#3,opacity=0.5] ($#1+(0,#2)$) arc (90:270:\lb cm and #2 cm)
arc (270:90:\rb cm and #2 cm);
}

\tikzset{
moon colour/.style={
moon fill/.style={
fill=#1
}
},
sky colour/.style={
sky draw/.style={
draw=#1
},
sky fill/.style={
fill=#1
}
},
southern hemisphere/.style={
rotate=180
}
}

\makeatletter
\pgfcalendardatetojulian{2023-11-13}{\***@pgf@counta} % 2010-01-15 07:11
UTC -- http://aa.usno.navy.mil/cgi-bin/aa_moonphases.pl?year=2010&ZZZ=END
\def\synodicmonth{29.530588853}
\newcommand{\moon}[2][]{%
\edef\checkfordate{\noexpand\in@{-}{#2}}%
\checkfordate%
\ifin@%
\pgfcalendardatetojulian{#2}{\***@pgf@countb}%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro\dayssincenewmoon{\the\***@pgf@countb-\the\***@pgf@counta-(7/24+11/(24*60))}%
\pgfmathsetmacro\lunarage{mod(\dayssincenewmoon,\synodicmonth)}
\pgfkeys{/pgf/fpu=false}%%
\else%
\def\lunarage{#2}%
\fi%
%% auskommentiert, hier waren die Tage nach Neumond spiegelverkehrt %%
%
%
\pgfmathsetmacro\leftside{ifthenelse(\lunarage<=\synodicmonth/2,cos(360*(\lunarage/\synodicmonth)),1)}%
%
\pgfmathsetmacro\rightside{ifthenelse(\lunarage<=\synodicmonth/2,-1,-cos(360*(\lunarage/\synodicmonth))}%$
%
%%%%%%%% korrigierte zwei Zeilen ifthenelse von ChatGPT
%%%%%%%%%%%%%%%%%%%%%%
\pgfmathsetmacro\leftside{ifthenelse(\lunarage<=\synodicmonth/2,cos(360*(\lunarage/\synodicmonth)),ifthenelse(\lunarage<=\synodicmonth,-1,1))}
\pgfmathsetmacro\rightside{ifthenelse(\lunarage<=\synodicmonth/2,1,ifthenelse(\lunarage<=\synodicmonth,-cos(360*(\lunarage/\synodicmonth)),1))}
\tikz [moon colour=white,sky colour=black,#1]{
\draw [moon fill, sky draw] (0,0) circle [radius=1ex];
\draw [sky draw, sky fill] (0,1ex)
arc (90:-90:\rightside ex and 1ex)
arc (-90:90:\leftside ex and 1ex)
-- cycle;
}%
}
\makeatother

\newcommand{\newmoon}{\moon{0}}
\newcommand{\waxingcrescent}{\moon{\synodicmonth/8}}
\newcommand{\firstquartermoon}{\moon{2*\synodicmonth/8}}
\newcommand{\waxinggibbous}{\moon{3*\synodicmonth/8}}
\newcommand{\fullmoon}{\moon{4*\synodicmonth/8}}
\newcommand{\waninggibbous}{\moon{5*\synodicmonth/8}}
\newcommand{\thirdquartermoon}{\moon{6*\synodicmonth/8}}
\newcommand{\waningcrescent}{\moon{7*\synodicmonth/8}}
\begin{document}\noindent\raggedleft%


%% Tage nach dem Neumond erscheinen nicht mehr spiegelverkehrt %%%%%
\foreach \d in {1,2,...,30}{%
\d: \moon{\year-11-\d} \ }


\end{document}
Heiner Richter
2023-11-16 07:05:41 UTC
Permalink
... nur muss man jetzt in Zeile 40 ein Vollmond-Datum statt eines
Neumond-Datums nehmen, also zB

\pgfcalendardatetojulian{2023-11-27}{\***@pgf@counta}
Heiner Richter
2023-11-16 08:51:37 UTC
Permalink
Post by Heiner Richter
... nur muss man jetzt in Zeile 40 ein Vollmond-Datum statt eines
Neumond-Datums nehmen, also zB
So mit nochmals korrigierer \rightside funktioniert jetzt auch der
zunehmende Mond, (und ja vielleicht sollte ich endlich mal LuaLaTeX bzw.
XeTeX in Angriff nehmen):

%%%%%%%%%%%%% Minimalbeispiel %%%%%%%%%%%%%%%%
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calendar,fpu,calc}

\tikzset{
moon colour/.style={
moon fill/.style={
fill=#1
}
},
sky colour/.style={
sky draw/.style={
draw=#1
},
sky fill/.style={
fill=#1
}
},
southern hemisphere/.style={
rotate=180
}
}

\makeatletter
\pgfcalendardatetojulian{2023-11-27}{\***@pgf@counta} % 2010-01-15 07:11
UTC -- http://aa.usno.navy.mil/cgi-bin/aa_moonphases.pl?year=2010&ZZZ=END
\def\synodicmonth{29.530588853}
\newcommand{\moon}[2][]{%
\edef\checkfordate{\noexpand\in@{-}{#2}}%
\checkfordate%
\ifin@%
\pgfcalendardatetojulian{#2}{\***@pgf@countb}%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro\dayssincenewmoon{\the\***@pgf@countb-\the\***@pgf@counta-(7/24+11/(24*60))}%
\pgfmathsetmacro\lunarage{mod(\dayssincenewmoon,\synodicmonth)}
\pgfkeys{/pgf/fpu=false}%%
\else%
\def\lunarage{#2}%
\fi%
%
\pgfmathsetmacro\leftside{ifthenelse(\lunarage<=\synodicmonth/2,cos(360*(\lunarage/\synodicmonth)),ifthenelse(\lunarage<=\synodicmonth,-1,1))}
%
\pgfmathsetmacro\rightside{ifthenelse(\lunarage<=\synodicmonth/2,1,ifthenelse(\lunarage<=\synodicmonth,-cos(360*(\lunarage/\synodicmonth)),1))}
\pgfmathsetmacro\leftside{ifthenelse(\lunarage<=\synodicmonth/2,cos(360*(\lunarage/\synodicmonth)),-cos(360*(\lunarage/\synodicmonth)))}
\pgfmathsetmacro\rightside{ifthenelse(\lunarage<=\synodicmonth/2,1,-1)}
\tikz [moon colour=white,sky colour=black,#1]{
\draw [moon fill, sky draw] (0,0) circle [radius=1ex];
\draw [sky draw, sky fill] (0,1ex)
arc (90:-90:\rightside ex and 1ex)
arc (-90:90:\leftside ex and 1ex)
-- cycle;
}%
}
\makeatother


\begin{document}\noindent\raggedleft%


%% Tage nach dem Neumond erscheinen spiegelverkehrt %%%%%
\foreach \d in {1,2,...,30}{%
\d: \moon{\year-11-\d} \ }


\end{document}
Heiner Richter
2023-11-16 10:36:22 UTC
Permalink
Post by Heiner Richter
... nur muss man jetzt in Zeile 40 ein Vollmond-Datum statt eines
Neumond-Datums nehmen, also zB
Nein es klappt in dem Minimalbeispiel auch mit Hilfe von ChatGPT nicht
richtig und die zunehmenden Monde sind auf der falschen Seite.
Ulrich D i e z
2023-11-16 10:43:13 UTC
Permalink
... nur muss man jetzt in Zeile 40 ein Vollmond-Datum statt eines Neumond-Datums nehmen, also zB
Nein es klappt in dem Minimalbeispiel auch mit Hilfe von ChatGPT nicht richtig und die zunehmenden Monde sind auf der falschen Seite.
Warum sollte es mit ChatGPT klappen?

ChatGPT interessiert sich nicht dafür, ob etwas korrekt funktioniert,
sondern brabbelt Verlautbarungen, bei denen es irgendwie etwas
berechnet hat, was es für ein Maß für eine hohe Wahrscheinlichkeit
dafür hält, dass dem Chatpartner diese Wortaneinanderreihungen
gefallen könnten.

ChatGPT sollte nicht als etwas missverstanden werden, was einem
ermöglicht, darum herum zu kommen, zu verstehen, was man tut.

Ulrich
Heiner Richter
2023-11-16 12:48:15 UTC
Permalink
Post by Ulrich D i e z
... nur muss man jetzt in Zeile 40 ein Vollmond-Datum statt eines Neumond-Datums nehmen, also zB
Nein es klappt in dem Minimalbeispiel auch mit Hilfe von ChatGPT nicht richtig und die zunehmenden Monde sind auf der falschen Seite.
Warum sollte es mit ChatGPT klappen?
ChatGPT interessiert sich nicht dafür, ob etwas korrekt funktioniert,
sondern brabbelt Verlautbarungen, bei denen es irgendwie etwas
berechnet hat, was es für ein Maß für eine hohe Wahrscheinlichkeit
dafür hält, dass dem Chatpartner diese Wortaneinanderreihungen
gefallen könnten.
ChatGPT sollte nicht als etwas missverstanden werden, was einem
ermöglicht, darum herum zu kommen, zu verstehen, was man tut.
Ulrich
Diese Mondphasen Tikz-Codes sind leider so fernab von dem, was ich
jemals verstehen würde.

Viele Grüße
Heiner

Und mit hin und her GeChatte und diversen Mondrotationen und
-transformationen kam am Ende tatsächlich sowas heraus:

%%%%%%%%%%% Beispiel %%%%%%%%%%%%%%%%%%%%
%%%Minimalbeispiel %%%%%%%%%%%%%%%%
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calendar,fpu,calc}

\tikzset{
moon colour/.style={
moon fill/.style={
fill=#1
}
},
sky colour/.style={
sky draw/.style={
draw=#1
},
sky fill/.style={
fill=#1
}
},
southern hemisphere/.style={
rotate=180
}
}

\makeatletter
\pgfcalendardatetojulian{2023-11-13}{\***@pgf@counta}
\def\synodicmonth{29.530588853}
\newcommand{\moon}[2][]{%
\edef\checkfordate{\noexpand\in@{-}{#2}}%
\checkfordate%
\ifin@%
\pgfcalendardatetojulian{#2}{\***@pgf@countb}%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro\dayssincenewmoon{\the\***@pgf@countb-\the\***@pgf@counta-(7/24+11/(24*60))}%
\pgfmathsetmacro\lunarage{mod(\dayssincenewmoon,\synodicmonth)}
\pgfkeys{/pgf/fpu=false}%
\else%
\def\lunarage{#2}%
\fi%
\pgfmathsetmacro\leftside{ifthenelse(\lunarage<=\synodicmonth/2,cos(360*(\lunarage/\synodicmonth)),1)}
\pgfmathsetmacro\rightside{ifthenelse(\lunarage<=\synodicmonth/2,1,cos(360*(\lunarage/\synodicmonth)))}
\tikz [moon colour=white, sky colour=black, #1]{
\draw [moon fill, sky draw] (0,0) circle [radius=1ex];
\pgfmathsetmacro\moonrotation{ifthenelse(Mod(\lunarage,\synodicmonth)
Post by Ulrich D i e z
\synodicmonth/2,180,0)}
\ifdim\moonrotation pt>0pt
\pgflowlevelsynccm
\pgftransformxscale{-1}
\fi
\draw [sky draw, sky fill] (0,1ex)
arc (90:-90:\rightside ex and 1ex)
arc (-90:90:\leftside ex and 1ex)
-- cycle;
\ifdim\moonrotation pt>0pt
\pgflowlevelsynccm
\fi
}
}

\makeatother


\begin{document}\noindent\raggedleft%


%% Tage nach dem Neumond erscheinen nicht mehr spiegelverkehrt %%%%%
\foreach \d in {1,2,...,30}{%
\d: \moon{\year-11-\d} \ }


\end{document}
Dr Eberhard Lisse
2023-11-16 07:44:36 UTC
Permalink
Mach doch mal beides (TeX und Lua) und schau mal wie lange das dauert :-)-O

mfg, el
[...]
Post by Heiner Richter
...
Danke für die Antwort, die mich auf die Idee brachte, zum ersten Mal
ChatGPT zu befragen, und tatsächlich erhielt ich korrigierten Code.
[...]
--
To email me replace 'nospam' with 'el'
Ulrich D i e z
2023-11-16 10:36:44 UTC
Permalink
<https://de.wikipedia.org/wiki/TOFU>

Ulrich
Dr Eberhard W Lisse
2023-11-16 14:35:46 UTC
Permalink
Fullquote? Welches Fullquote?
Post by Ulrich D i e z
<https://de.wikipedia.org/wiki/TOFU>
Ulrich
Ulrich D i e z
2023-11-16 19:55:40 UTC
Permalink
Post by Dr Eberhard W Lisse
Fullquote? Welches Fullquote?
Das interessantere Stichwort in dem Wikipedia-Artikel ist
"Inline Quoting".

Wenn in den verschiedenen Zitatebenen Inline-Quoting von oben
nach unten praktiziert wird, sodass tiefere Zitatebenen weiter
oben stehen, gerät das Lesen zu einer argen Herumscrollerei
wenn jemand seine Verlautbarungen, die, wenn man darauf
eingeht, zur obersten Zitierbene werden, oben drüber schreibt.

Zugegebenermaßen war ich vorhin aber wegen starker Schmerzen
in einer Stimmung, die von Quengeligkeit und Unleidigsein
geprägt ist - normalerweise sind mir solche Sachen nämlich
egal. Insofern bitte ich für mein voriges Posting um
Vergebung.

Mit freundlichem Gruß

Ulrich
Dr Eberhard W Lisse
2023-11-16 20:11:29 UTC
Permalink
In einem gekürzten Post, wo man alles auf einem Schirm sieht?

Mich stört viel mehr, und seit ungefähr 35 Jahren, dass man
bei fast jedem Post in einem Thread herunterblättern muss,
auch wenn man die zitierten Texte schon mehrfach gelesen hat.

Und es ist ja nicht so als ob man in einem Thread nicht im
Thema ist.

el
Post by Ulrich D i e z
Post by Dr Eberhard W Lisse
Fullquote? Welches Fullquote?
[...]
Post by Ulrich D i e z
Wenn in den verschiedenen Zitatebenen Inline-Quoting von
oben nach unten praktiziert wird, sodass tiefere Zitatebenen
weiter oben stehen, gerät das Lesen zu einer argen
Herumscrollerei wenn jemand seine Verlautbarungen, die, wenn
man darauf eingeht, zur obersten Zitierbene werden, oben
drüber schreibt.
[...]

Lesen Sie weiter auf narkive:
Loading...