calculateTriangle