All triangle between q and p are acute triangles . So add q - p in z .
z += q - p ; } } } document . write ( " " + x + " " ) ; document . write ( " " + y + " " ) ; document . write ( " " + z + " " ) ; }