3D Slicer Curve Annotation

Can anyone tell me what the equation that is used for the curve annotation tool is to calculate the curvature for the mean and max curvature metrics?

You can find the computation in the vtkCurveMeasurementsCalculator filter source code: