private double adjustBetaSign ( double beta , List < Point3D_F64 > nullPts ) { if ( beta == 0 ) return 0 ; int N = alphas . numRows ; int positiveCount = 0 ; for ( int i = 0 ; i < N ; i ++ ) { double z = 0 ; for ( int j = 0 ; j < numControl ; j ++ ) { Point3D_F64 c = nullPts . get ( j ) ; z += alphas . get ( i , j ) * c . z ; } if ( z > 0 ) positiveCount ++ ; } if ( positiveCount < N / 2 ) beta *= - 1 ; return beta ; }
Use the positive depth constraint to determine the sign of beta