Calculation of triangle in 17×9 rectangle