POV-Ray : Newsgroups : povray.advanced-users : Defining new math functions Server Time
24 Nov 2024 09:34:45 EST (-0500)
  Defining new math functions (Message 1 to 4 of 4)  
From: michaelk
Subject: Defining new math functions
Date: 20 Jul 2007 08:25:02
Message: <web.46a0a902f6361d5acc856a90@news.povray.org>
Hello all,
I woould like to ask how to best add support for special functions like Airy
or Bessel functions to povray. The straighforward approach would be to add a
new switch like NEED_SPECIAL (similar to NEED_INVHYP) and add these new
functions into
all the needed places, which seem to be the files:
#grep asinh `find source -name '*.*' -print`
source/express.cpp:               Val = asinh(Parse_Float_Param());
source/fnpovfpu.cpp:    asinh,          // 9
source/fnsyntax.cpp:                    result = asinh(node->child->number);
source/mathutil.cpp:DBL asinh(DBL x)
source/mathutil.h:DBL asinh(DBL x);
source/tokenize.cpp:  {ASINH_TOKEN, "asinh"},
and the (.h files). Functions of two arguments can be modelled on atan2 and
such
(by the way, what about three arguments?).

I need this for visualisation of some physical situations in physics. I
would not like to use spline approximations, the regular Bessel function
J_n(x), grows like x^n near the origin and looks like sin(x) for large
values of x, for example. While it still would be possible to define it
without resorting to source changes it would certainly be a lot slower and
more awkward.

So, is what I described above the best way to proceed or is there a better
way?

Thanks

Michael


Post a reply to this message

From: Penelope20k
Subject: Re: Defining new math functions
Date: 20 Jul 2007 08:42:04
Message: <46a0ad9c$1@news.povray.org>
???

sniiffff... need to return to povray.newusers ..... sniff...















web.46a0a902f6361d5acc856a90@news.povray.org...
> Hello all,
> I woould like to ask how to best add support for special functions like
Airy
> or Bessel functions to povray. The straighforward approach would be to add
a
> new switch like NEED_SPECIAL (similar to NEED_INVHYP) and add these new
> functions into
> all the needed places, which seem to be the files:
> #grep asinh `find source -name '*.*' -print`
> source/express.cpp:               Val = asinh(Parse_Float_Param());
> source/fnpovfpu.cpp:    asinh,          // 9
> source/fnsyntax.cpp:                    result =
asinh(node->child->number);
> source/mathutil.cpp:DBL asinh(DBL x)
> source/mathutil.h:DBL asinh(DBL x);
> source/tokenize.cpp:  {ASINH_TOKEN, "asinh"},
> and the (.h files). Functions of two arguments can be modelled on atan2
and
> such
> (by the way, what about three arguments?).
>
> I need this for visualisation of some physical situations in physics. I
> would not like to use spline approximations, the regular Bessel function
> J_n(x), grows like x^n near the origin and looks like sin(x) for large
> values of x, for example. While it still would be possible to define it
> without resorting to source changes it would certainly be a lot slower and
> more awkward.
>
> So, is what I described above the best way to proceed or is there a better
> way?
>
> Thanks
>
> Michael
>
>


Post a reply to this message

From: Stephen
Subject: Re: Defining new math functions
Date: 20 Jul 2007 09:30:02
Message: <web.46a0b8a043522348c4e49fa40@news.povray.org>
"Penelope20k" <pen### [at] caramailfr> wrote:
> ???
>
> sniiffff... need to return to povray.newusers ..... sniff...

LOL - me too :-)


Stephen


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Defining new math functions
Date: 20 Jul 2007 10:49:12
Message: <46a0cb68$1@news.povray.org>
Please do not multi-post. Answer in p.unofficial.patches.

	Thorsten, POV-Team


Post a reply to this message

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