POV-Ray : Newsgroups : povray.advanced-users : Calculating planet positions : Re: Calculating planet positions Server Time
24 Apr 2024 07:22:27 EDT (-0400)
  Re: Calculating planet positions  
From: Bald Eagle
Date: 15 Sep 2018 16:15:00
Message: <web.5b9d6796fda659e4458c7afe0@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> Interesting. It seems I posted in that thread too.

Yes.   :D


> Quote:
>
> "Modulos the mean anomaly so that -180 <= M <= +180 ..."

5 sec search yielded:
https://lite.qwant.com/?q=""modulus+the+mean+anomaly

https://math.stackexchange.com/questions/1325434/modulus-to-a-range-x-to-x

I do believe that this is typically done with a macro, and occurs in the POV-Ray
source code.

#macro Modulate (_X)
     #while (_X < 180) #local _X = _X+360; #end
     #While (_X > 180) #local _X = _X-360; #end
     _X
#end

type of thing.

Then of course, there's
http://www.povray.org/documentation/view/3.6.2/458/

clamp(V, Min, Max). A function that limits a value to a specific range, if it
goes outside that range it is "clamped" to this range, wrapping around. As the
input increases or decreases outside the given range, the output will repeatedly
sweep through that range, making a "sawtooth" waveform.
Parameters:

V = Input value.
Min = Minimum of output range.
Max = Maximum of output range.


Bill


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.