POV-Ray : Newsgroups : povray.unofficial.patches : Defining new math functions : Re: Defining new math functions Server Time
27 Apr 2024 22:50:59 EDT (-0400)
  Re: Defining new math functions  
From: Thorsten Froehlich
Date: 20 Jul 2007 10:46:56
Message: <46a0cae0$1@news.povray.org>
michaelk wrote:
> 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?).

No, this is pretty much the wrong way to add special purpose functions. Add
them to fnintern.cpp similar to all the other special purpose functions.

	Thorsten


Post a reply to this message

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