fixed inOutTriangle