calculateTriang