POV-Ray : Newsgroups : povray.general : Roots of a function : Re: Roots of a function Server Time
3 May 2024 12:26:45 EDT (-0400)
  Re: Roots of a function  
From: Bald Eagle
Date: 28 Sep 2019 08:10:01
Message: <web.5d8f4d4eb127c26f4eec112d0@news.povray.org>
"IGM" <iar### [at] gmailcom> wrote:
> Hi,
> I have a monotone function y=(x) defined as spline (it describes the position of
> an object in the scene), and I need to find its root, i.e. where it crosses x
> axis. Is there any elegant way to do this inside povray? Maybe I could transform
> the function in a prism surface, and using "trace" to find the intersection of a
> ray at height y=0 with the surface. Other ideas?
>
> Thanks!
> igmar

You could do it the typical algebraic way and solve for x, where y=0.
You could do it numerically, where you use a #for loop and choose an increment
for x, evaluating the function and checking each iteration to see if y<= some
small amount.
If you actually want to harness [one or more of] POV-Ray's internal root
solvers, that's currently William Pokorny's domain.

If you want to do it "graphically", maybe you could do something like define a
cylinder for the x-axis, and a sphere-sweep for the function, and do an
intersection{}.  Then maybe use trace () and/or eval_pigment to find those
regions, replace with spheres encompassing those regions, redo the intersections
and find the center of the bounding box.   Iterate to a small value.


There are also online equation root solvers that you can just plug in your
equation, and it will spit the answer out from the black box.  :D

That's all I've got [so far] pre-1st-coffee.


Post a reply to this message

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