def _chpi_objective(x, coil_dev_rrs, coil_head_rrs):
 d = np.dot(coil_dev_rrs, quat_to_rot(x[:3]).T)
 d += (x[3:] / 10.0)
 d -= coil_head_rrs
 d *= d
 return d.sum()

def _chpi_objective ( x , coil_dev_rrs , coil_head_rrs ) : d = np . dot ( coil_dev_rrs , quat_to_rot ( x [ : 3 ] ) . T ) d += ( x [ 3 : ] / 10.0 ) d -= coil_head_rrs d *= d return d . sum ( )
helper objective function .