Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To count the length of the segment, we count the number of unit segments that compose it. Start with 1 (the first segment) and count up to 4 (the fourth segment), yielding a length of 4. We're consistent with the units: we are adding up lengths to get a length (metres, yards, or whatever).

Counting (ie, adding up) points gives a number of points, which isn't a unit for lengths. Starting the enumeration from zero is a hack to recover the previous process of adding up unit lengths.

This hack only works in this specific context of conversion. If you want to count points (say, the number of corners in the triangle) you'd need to start from 1.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: