I have the feeling that your "inside" method is not consistent with the "orientation" method, in the case where p is inside A and p is on the boundary of B.