function r = h3d_get_one_perpendicular(v) % r = h3d_get_one_perpendicular(v) % r is such that r'v = 0 % choose any vector perpendicular to axis if abs(v' * [1;0;0]) < 0.9 r = normalize(cross(v,[1;0;0])); else r = normalize(cross(v,[0;1;1])); end if abs(r'*v) > 1e-8 error end