POV-Ray : Newsgroups : povray.beta-test : Functions more than 65535 : Re: Functions more than 65535 Server Time
29 Jul 2024 18:15:55 EDT (-0400)
  Re: Functions more than 65535  
From: Tor Olav Kristensen
Date: 15 May 2002 04:07:40
Message: <3CE2167C.37235931@hotmail.com>

> 
> On Tue, 14 May 2002 19:54:50 +0200, Tor Olav Kristensen
> <tor### [at] hotmailcom> wrote:
> > If there is enough interest in these macros, then
> > maybe I'll take the time to make some documentation
> > or examples on how to use them.
> 
> just rewrite it as functions, I need solver as function for iso_csg library

That would generate a somewhat ugly function !

And it would be limited too, because I think
that it is difficult to make functions that
are able to do polynomial divisions of arbitrary
degree polynomials as it goes along.

But maybe something can be done in the 3D case;

One function uses Newton/Raphson method to find a
root and then returns it. Three other functions
receives this root together with the coefficients
for the 3rd deg polynomial, which they use for
polynomial division and returns a single coefficient
each for the resulting 2dn deg polynomial. Then two
more functions receives these 3 coefficients and
calculates one root each of the 2nd deg polynomial.

#declare PolyFn = function(x) { a + b*x + c*x^2 + d*x^3 }
#declare DifferentiatedPolyFn = function(x) { b + 2*c*x + 3*d*x^2 }

// Uses PolyFn and DifferentiatedPolyFn
#declare Root1Fn = function(a, b, c, d) { ... }

// Uses Root1Fn
#declare D_2D_Fn = function(A, B, C, D, R) { ... }
#declare E_2D_Fn = function(A, B, C, D, R) { ... }
#declare F_2D_Fn = function(A, B, C, D, R) { ... }

// 2nd deg polynomial is now:
//  D_2D_Fn(a,b,c,d,Root1Fn(a,b,c,d))
// +E_2D_Fn(a,b,c,d,Root1Fn(a,b,c,d))*x
// +F_2D_Fn(a,b,c,d,Root1Fn(a,b,c,d))*x^2

// Uses D_2D_Fn, E_2D_Fn and F_2D_Fn
#declare Root2 = function(D, E, F) { ... }
#declare Root3 = function(D, E, F) { ... }


Tor Olav

Btw.: Congratulations !!!
I guess you'll have less time for POV-ing now ;)


Post a reply to this message

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