You get slightly different results with the determinant function:
function out = floatOrient(p,q,r)

out = sign( det([q-p;r-p]) );

end

I had something similar in my solution as well:

http://www.mathworks.com/matlabcentral/cody/problems/820-eliminate-unnecessary-polygon-vertices/solutions/110953

]]>