3D normal and curvature calculations

Hi friends,
I need to calculate the normal vector which requires calculating first and second order partial derivatives at a point on a 3D body

I had calculated the derivatives of a point on a Bezier patch(analytically)(Ref: Gerald Farin - Curves and Surfaces for CAGD_ A Practical Guide, Fifth Edition (2001)).

To verify my result I created a cylindrical patch in rhino and I took the parametric details such as u and v and I calculated the required partial derivatives. But answers are not matching for 3D normal vector and also for the principal curvature. you can find details in attached pdf. I would be very thankful if some one can point the mistake.
pic.pdf (603.4 KB)

If you created the cylindrical surface using an arc or a cylinder then the surface is rational with weights other than 1.0. If the surface is rational did you account for the different weights in your calculations?

Dear David , thanks for your reply. I created the cylinder from solid creation>explode all>>to NURBS>>Bezier patches.
I took the CV that are marked in below attachment

The surface is rational. Note that the listing says “Control Points 6 rational points”.
The weights for CV[1][0] and CV[1][1] are 0.70710678118654757 (sqrt(2)/2)
You need to use the weights when calculating the derivatives. See section 13.3 of Gerald Farin - Curves and Surfaces for CAGD_ A Practical Guide, Fifth Edition (2001)

Thanks, David, for your valuable suggestions!

I couldn’t find the derivative of the rational Bezier surface in the textbook we are referring to. Please let me know if you have any references that gives a mathematical expression of the derivative of rational bezier surface.

A Bezier surface is a single span NURBS surface.
The NURBS Book 2nd Edition, Piegl and Tiller, 1995 and 1997, Chapter Four Rational B-Spline Curves and Surfaces