Implements rectangle_in_triangle, tested and confirmed working.