Reworked algorithm to check if in out of boundaries point. Two methods created to work out the triangle and rectangle areas. A method which gets the positions and checks if the current x, y is in the boundaries and resets positions.