def _get_ctf_head_to_head_t(idx_points):
 fp = idx_points.astype('>f8')
 dp = np.sum((fp[2] * (fp[0] - fp[1])))
 (tmp1, tmp2) = (sum_squared(fp[2]), sum_squared((fp[0] - fp[1])))
 dcos = ((- dp) / np.sqrt((tmp1 * tmp2)))
 dsin = np.sqrt((1.0 - (dcos * dcos)))
 dt = (dp / np.sqrt(tmp2))
 t = np.array([[dcos, (- dsin), 0.0, dt], [dsin, dcos, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])
 return Transform('ctf_head', 'head', t)

def _get_ctf_head_to_head_t ( idx_points ) : fp = idx_points . astype ( '>f8' ) dp = np . sum ( ( fp [ 2 ] * ( fp [ 0 ] - fp [ 1 ] ) ) ) ( tmp1 , tmp2 ) = ( sum_squared ( fp [ 2 ] ) , sum_squared ( ( fp [ 0 ] - fp [ 1 ] ) ) ) dcos = ( ( - dp ) / np . sqrt ( ( tmp1 * tmp2 ) ) ) dsin = np . sqrt ( ( 1.0 - ( dcos * dcos ) ) ) dt = ( dp / np . sqrt ( tmp2 ) ) t = np . array ( [ [ dcos , ( - dsin ) , 0.0 , dt ] , [ dsin , dcos , 0.0 , 0.0 ] , [ 0.0 , 0.0 , 1.0 , 0.0 ] , [ 0.0 , 0.0 , 0.0 , 1.0 ] ] ) return Transform ( 'ctf_head' , 'head' , t )
get the ctf head transform .