Update fillTriangle to remove unnecessary calculations