restrict testing to point that are closer than 0.5*M_PI apart. That's a hacky way to avoid degenerate cases [[Imported from SVN: r8038]]