Advertisement

Min and Max of polynomial

Started by February 16, 2003 02:48 PM
10 comments, last by LinaInverse2010 22 years ago
I don''t think we can parameratize it in terms of t when finding the solution. The only reason it is ever parameratized with t is for finding the intersection of a ray and the polynomial. So if it is parameratized with t, it only gives us points on the line described by the ray, but I want the absolute bounds of the surface. Of course I know some surfaces won''t have bounds, but I consider those special cases and shouldn''t be accounted for.

To calrify, I need to find the max and min values of each variable solving this equality: f(x,y,z) = 0 for any n-degree polynomial of x, y, and z.

It would be like finding the max and min x, y, z values for this:

f(x,y,z) = z^2*x^2 - z^4 - 2*z*x^2 + 2*z^3 + x^2 - z^2 - x^4 + x*x^2*z - y^4 - 2*x^2*y^2 - y^2*z^2 + 2*y^2*z + y^2 = 0

Where if f(x,y,z) < 0 it is inside the object, and otherwise its outside. NOTE: This is a real example surface that can be rendered in my raytracer.

The purpose of this is for a raytracer. It already supports drawing a polynomial of any degree, and I want some automated way to build a bounding box for it. So, for example, in the case above I would want the mininum and maximum values of x given y, z can be anything. Then I would do the same for y and z. I''m not even sure if its possible (or reasonably simple) to solve this.

Of course I could just take tons of sample points and try to guess the bounding box, but the purpose of a raytracer is accuracy, and I don''t want to lose that.

LinaInverse2010
I am not sure how helpful this will be computationally but here goes.

You have some implicit description of the surface given by
F(x,y,z) = 0.

First calculate the vector grad F = (dF/dx, dF/dy, dF,dz). You then need to find where this vector is parallel to (1,0,0), (0,1,0) and (0,0,1) respectively.

For the first case this means 3 polynomial equations,

dF/dx = C (some constant)
dF/dy = 0
dF/dz = 0

This is 3 equations in 4 unknowns, you can eliminate x and find out where the critical points in the x-direction will be in terms of y and z. Substitute these critical points into F(x,y,z) = 0 to find the largest values along the x-direction and you''ve got two bounding planes. The other 4 would be found similarly.

Systems of polynomial equations like the one above can be solved numerically. Look up Groebner Bases (but don''t be put off by any complicated maths). They are a little like Gauss-Jordan reduction for polynomial equations, and there are undoubtably libraries out there for them.

good luck too btw

This topic is closed to new replies.

Advertisement