POV-Ray : Newsgroups : povray.text.scene-files : Planetarium : Re: Planetarium Server Time30 May 2024 09:56:34 EDT (-0400)
 Re: Planetarium
 From: Mike Horvath Date: 13 Sep 2018 22:16:07 Message: <5b9b19e7\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5b9b19e7%241%40news.povray.org",
"dateCreated": "2018-09-14T02:16:07+00:00",
"datePublished": "2018-09-14T02:16:07+00:00",
"author": {
"@type": "Person",
"name": "Mike Horvath"
}
}
On 9/13/2018 8:43 PM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>
>> I believe I have all the pieces already.
>
> Having worked on this already, there may be more to it...
>
>> But how do I convert the
>> calculations into the functions a parametric object requires? For
>> example, what do I use for u and v?
>
> // Create a set of points on the surface of a Torus
> #declare X = function (T, P, R, r) {cos(T) * ( R + r * cos(P) )}
> #declare Y = function (T, P, R, r) {-sin(T) * ( R + r * cos(P) )}
> #declare Z = function (T, P, r, n) {r * sin(P)}
>
> Phi (U) is the small radius, and Theta  (V) is the large radius.
>
> Just set your Theta range from 0 to .... wherever your planet is.
>
> But a native parametric {} object is going to be ...
> SLLLLLLLLLOOOOOOOOOOOOOOWWWWWWWWWwwwwwwwwwww.
>
> If you're going to do that kind of thing, use a polynomial {}.
>
>

How do I split such a function into parts? For instance

#declare X = function (T, P, R, r) {cos(T) * ( R + r * cos(P) )}
#declare Y = function (T, P, R, r) {-sin(T) * ( R + r * cos(P) )}
#declare Z = function (T, P, r, n) {r * sin(P)}

Mike
```