Richard Baker Posted November 15, 2021 Posted November 15, 2021 For simplicity, I am only using second order NURBS. I have a NURBS surface which essentially takes the form of x(u,v) and y(u,v) and z(u,v) are all quadratic functions of u and v. Would I be correct to say that there exists a quadric of the form 0=ax2 + by2 + cz2 + dxy + eyz + fzx + gx + hy + iz + j which is equivalent to the parametric representation? I tried applying Kramer's rule to interpolate the test points along the parametric representation but the determinant of the 9x9 matrix = 0 and I get a divide by 0 error.
Sensei Posted November 15, 2021 Posted November 15, 2021 (edited) 56 minutes ago, Richard Baker said: For simplicity, I am only using second order NURBS. I have a NURBS surface which essentially takes the form of x(u,v) and y(u,v) and z(u,v) are all quadratic functions of u and v. Would I be correct to say that there exists a quadric of the form 0=ax2 + by2 + cz2 + dxy + eyz + fzx + gx + hy + iz + j which is equivalent to the parametric representation? I tried applying Kramer's rule to interpolate the test points along the parametric representation but the determinant of the 9x9 matrix = 0 and I get a divide by 0 error. Show source code... Whenever a programmer uses a division operator with a non-static denominator he/she must catch a divide by zero in advance or exception. *) The code in C/C++ e.g. double a, b, c, d; // initialized double e = a * b / ( c * d ); is incorrect/wrong since the beginning. It should be: double a, b, c, d; // initialized double x = c * d; // temporary variable double e = ( x != 0 ) ? a * b / x : DBL_MAX; (alternative to DBL_MAX are https://stackoverflow.com/questions/5834635/how-do-i-get-double-max or https://stackoverflow.com/questions/8690567/setting-an-int-to-infinity-in-c or https://en.cppreference.com/w/c/numeric/math/INFINITY ) Whether dividing by zero is treated as dividing by a very small value (leading to the result of infinity) depends on the context... *) not obeying this rule will lead to random application crashes.. Edited November 15, 2021 by Sensei
Richard Baker Posted November 17, 2021 Author Posted November 17, 2021 Perhaps I ill-phrased my question. The problem is not the divide by zero error, it is a fact that when I apply Kramer's rule the determinant of the denominator matrix is zero. From my understanding this means the system of the equations is not defined. My question is why is it not defined and how do I make it defined? To summarize, I have nine points that I want to interpolate using an implicit quadric surface which may be a sphere, parabolic, hyperboloid, or cylinder etc. This quadric surface has nine unknowns, the coefficients a - i assuming j equals one. So why is the surface not defined?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now