POV-Ray : Newsgroups : povray.beta-test : Functions more than 65535 Server Time
29 Jul 2024 18:17:38 EDT (-0400)
  Functions more than 65535 (Message 21 to 30 of 34)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 14 May 2002 04:29:58
Message: <3ce0cb06@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> Btw such conclusion, have you noticed my hidden request posted somewhere about
> gate between functions and polynomial solver ? I told I would try to implement
> it in the future but perhaps it already exists on some of your drives... :-)

It would have to return multiple results in some cases, which is not really
possible right now...

Once there is a full programming language available in 4.0 I suppose many of
the interesting internal functions can be made available.

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: Functions more than 65535
Date: 14 May 2002 04:37:42
Message: <7vi1eu8k1r551rrg53o48arjtonfnkv6r5@4ax.com>
On Tue, 14 May 2002 10:29:54 +0200, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> It would have to return multiple results in some cases, which is not really
> possible right now...

But knowing max order of polynomial I know max number of roots so can ask for
n-th root. Additional function could return number of roots to check if there
is any.

ABX


Post a reply to this message

From:
Subject: Re: Functions more than 65535
Date: 14 May 2002 04:47:58
Message: <bkj1eu4k0ei3hqo426i06t0jnm3gb3t7od@4ax.com>
On Tue, 14 May 2002 10:29:54 +0200, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> Once there is a full programming language available in 4.0 I suppose many of
> the interesting internal functions can be made available.

shader ? raytracer in function VM in SDL ?

ABX


Post a reply to this message

From: Michael Goldshteyn
Subject: Re: Functions more than 65535
Date: 14 May 2002 09:07:03
Message: <3ce10bf7@news.povray.org>
Why not just call out to Perl and be done. All these hacky quick developed
new languages are a real pain, when Perl already does just about everything
you can want from a proramming language. I think you guys should be spending
time on improving realism/adding features instead of a new programming
language.

Mike

"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3ce0cb06@news.povray.org...
> Once there is a full programming language available in 4.0 I suppose many
of
> the interesting internal functions can be made available.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 14 May 2002 11:14:30
Message: <3ce129d6@news.povray.org>
In article <3ce10bf7@news.povray.org> , "Michael Goldshteyn" <mik### [at] wwacom>
wrote:

> Why not just call out to Perl and be done.

I won't even try to explain what nonsense such a suggestion is.

    Thorsten


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Functions more than 65535
Date: 14 May 2002 13:57:58
Message: <3CE14F6A.541E31CD@hotmail.com>

> 
> On Tue, 14 May 2002 10:29:54 +0200, "Thorsten Froehlich" <tho### [at] trfde>
> wrote:
> > It would have to return multiple results in some cases, which is not really
> > possible right now...
> 
> But knowing max order of polynomial I know max number of roots so can ask for
> n-th root. Additional function could return number of roots to check if there
> is any.

Funny that you should mention this now.

Since a few months after I started to use POV-Ray,
I have tried to make some macros that would do
matrix and polynomial calculations.

But the "Dangling pointer bug" made this work very
difficult.

But now that it is soon all gone, I have managed to
take these macros some further.

The code below shows how some of the polynomial
macros works as they are now.

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.


Tor Olav



#declare RR = array[5] { -3, 4, 0, 5, 1/3 }
PrintRoots(RR, "x")
// ((x + 3)*(x - 4)*x*(x - 5)*(x - 0.333333))


// Assemble a polynomial from roots:

// ((x + 3)*(x - 4)*x*(x - 5)*(x - 0.333333))
#declare P0 = P_FromRoots(RR)
Print_P(P0, "x")
// (0 -20*x +62.333333*x^2 -5*x^3 -6.333333*x^4 +x^5)


// Find real roots of a polynomial:

// (0 -20*x +187/3*x^2 -5*x^3 -19/3*x^4 +x^5)
PrintRoots(R_RootsOf_P(array[6] { 0, -20, 187/3, -5, -19/3, 1 }), "x")
// (x*(x - 0.333333)*(x - 5)*(x - 4)*(x + 3))


// Multiply two polynomials:

// (x - 4)*(x - 1/3) 
#declare P1 = P_Mult(P_FromRoot(4), P_FromRoot(1/3))
Print_P(P1, "x")
// (1.333333 -4.333333*x +x^2)


// Divide one polynomial by another:

// (0 -20*x +187/3*x^2 -5*x^3 -19/3*x^4 +x^5)/(4/3 -13/3*x +x^2)
Print_P(P_Div(P0, P1), "x")
// (0 -15*x -2*x^2 + x^3)


// Differentiate a polynomial once:

// (2 -A +3*A^2 +A^3 +A^4)
#declare P2 = array[5] { 2, -1, 3, 1, 1 }
Print_P(P_Diff(P2, 1), "A")
// (-1 +6*A +3*A^2 +4*A^3)


// Integrate a polynomial twice:

// (-1 +6*A +3*A^2 +4*A^3)
#declare P3 = array[4] { -1, 6, 3, 4 }
Print_P(P_Int(P3, 2), "A")
// (0 -0.500000*A^2 +A^3 +0.250000*A^4 +0.200000*A^5)


// Assemble polynomial from a multiple root:

// (t - 2)*(t - 2)*(t - 2)*(t - 2)*(t - 2)
Print_P(P_FromRepeatedRoot(2, 5), "t")
// (-32 +80*t -80*t^2 +40*t^3 -10*t^4 +t^5)


// Make a Bernstein polynomial:

Print_P(P_Bernstein(1, 4), "y")
// ( 0 +4*y -12*y^2 +12*y^3 -4*y^4)


// Make a Fibonacci polynomial:

#declare PF = P_Fibonacci(7)
Print_P(PF, "u")
// (1 + 6*u^2 +5*u^4 +u^6)

#declare Fib7PolyFn = PolyFunction(PF)
#debug str(Fib7PolyFn(1), 0, 0)
// 13 // I.e. the 7th Fibonacci number


// And several other more or less useful polynomial macros
// together with a whole set of matrix calculation macros.


Post a reply to this message

From: Warp
Subject: Re: Functions more than 65535
Date: 14 May 2002 16:46:10
Message: <3ce17791@news.povray.org>
Using this as a math library would be really cool:
http://www.parigp-home.de/

  That library is just incredible.
  Besides supporting arbitrarily long integer, rational and floating point
numbers and almost any mathematical function and operation you could imagine,
it's amazingly fast.
  For example it calculated the factors of the number
1000000000000000000000000000000000000000000000000000000003
(2448952313317 * 113619994412549 * 3593891055967117960201170304091)
in less than 13 seconds in this computer (500MHz UltraSparc).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 14 May 2002 16:56:40
Message: <3ce17a08@news.povray.org>
In article <3ce17791@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   Using this as a math library would be really cool:
> http://www.parigp-home.de/

Unfortunately it has the root of all evil attached to it (even worse it has
the 2.0 version attached) and it is not suitable for development of truly free
programs or any software that matters :-(

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Warp
Subject: Re: Functions more than 65535
Date: 14 May 2002 17:29:18
Message: <3ce181ad@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> Unfortunately it has the root of all evil attached to it (even worse it has
> the 2.0 version attached)

  What? Do you mean it's GPL?

> and it is not suitable for development of truly free
> programs or any software that matters :-(

  How so?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 14 May 2002 17:37:32
Message: <3ce1839c@news.povray.org>
In article <3ce181ad@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>> Unfortunately it has the root of all evil attached to it (even worse it has
>> the 2.0 version attached)
>
>   What? Do you mean it's GPL?

Yes, and it is the "real" GPL version 2.0, not LGPL :-(

>> and it is not suitable for development of truly free
>> programs or any software that matters :-(
>
>   How so?

All the nice new clauses in the 2.0 version of the GPL that allow the FSF (aka
RMS who forced these changed into version 2.0) to change the license as they
see fit against the original authors intent.  For all you know they could
decide to add a "may not be run on a non-GPL operating system" one day...

You know, RMS already decided to call Linux "GNU/Linux"...

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>

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