Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Automatische Vollmondberechnung

79 views
Skip to first unread message

Heiner Richter

unread,
Nov 12, 2023, 3:21:51 AM11/12/23
to
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

unread,
Nov 12, 2023, 6:37:05 AM11/12/23
to
https://www.latex4technics.com/?note=hcg

hier habe ich etwas dazu gefunden.

Heiner Richter

unread,
Nov 14, 2023, 2:12:59 AM11/14/23
to
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}{\c@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}{\c@pgf@countb}%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro\dayssincenewmoon{\the\c@pgf@countb-\the\c@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

unread,
Nov 15, 2023, 3:37:36 PM11/15/23
to
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

Heiner Richter

unread,
Nov 16, 2023, 1:49:57 AM11/16/23
to
Am 15.11.2023 um 21:37 schrieb Dr Eberhard W Lisse:
> Wäre das nicht etwas für Lua(TeX)?
>
> ChatGPT bietet soetwas an:
>
...
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);
%% 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

unread,
Nov 16, 2023, 2:05:43 AM11/16/23
to
Am 16.11.2023 um 07:49 schrieb Heiner Richter:
> Am 15.11.2023 um 21:37 schrieb Dr Eberhard W Lisse:
... nur muss man jetzt in Zeile 40 ein Vollmond-Datum statt eines
Neumond-Datums nehmen, also zB

\pgfcalendardatetojulian{2023-11-27}{\c@pgf@counta}

Dr Eberhard Lisse

unread,
Nov 16, 2023, 2:44:41 AM11/16/23
to
Mach doch mal beides (TeX und Lua) und schau mal wie lange das dauert :-)-O

mfg, el
On 16/11/2023 08:49, Heiner Richter wrote:
> Am 15.11.2023 um 21:37 schrieb Dr Eberhard W Lisse:
[...]
>> ChatGPT bietet soetwas an:
>>
> ...
> 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'

Heiner Richter

unread,
Nov 16, 2023, 3:51:39 AM11/16/23
to
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}{\c@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}{\c@pgf@countb}%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro\dayssincenewmoon{\the\c@pgf@countb-\the\c@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 %%%%%

Heiner Richter

unread,
Nov 16, 2023, 5:36:24 AM11/16/23
to
Am 16.11.2023 um 08:05 schrieb Heiner Richter:
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

unread,
Nov 16, 2023, 5:36:26 AM11/16/23
to

Ulrich D i e z

unread,
Nov 16, 2023, 5:42:56 AM11/16/23
to
Am 16.11.23 um 11:36 schrieb Heiner Richter:
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

unread,
Nov 16, 2023, 7:48:17 AM11/16/23
to
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}{\c@pgf@counta}
\def\synodicmonth{29.530588853}
\newcommand{\moon}[2][]{%
\edef\checkfordate{\noexpand\in@{-}{#2}}%
\checkfordate%
\ifin@%
\pgfcalendardatetojulian{#2}{\c@pgf@countb}%
\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro\dayssincenewmoon{\the\c@pgf@countb-\the\c@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)
> \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

Dr Eberhard W Lisse

unread,
Nov 16, 2023, 9:35:45 AM11/16/23
to
Fullquote? Welches Fullquote?

On 2023-11-16 12:36 , Ulrich D i e z wrote:
>
> <https://de.wikipedia.org/wiki/TOFU>
>
> Ulrich
>

Ulrich D i e z

unread,
Nov 16, 2023, 2:55:23 PM11/16/23
to
Am 16.11.23 um 15:35 schrieb 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

unread,
Nov 16, 2023, 3:11:33 PM11/16/23
to
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

On 16/11/2023 21:55, Ulrich D i e z wrote:
> Am 16.11.23 um 15:35 schrieb Dr Eberhard W Lisse:
>
>> Fullquote? Welches Fullquote?
[...]
> 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.
[...]
0 new messages