solved intersection and right triangle