remove dead code in get_centroid
The preceding return statement ensures none of the latter part of the function
is reachable. This was introduced in
05674ae147c14ec4ec74b2b6771e04e0c82209b8
and seemingly never noticed.
This commit also drops now-unused variables, as well as the static qualifier
from sum. It is not clear to me what the purpose of making sum static was. It is
a small struct and both its fields are overwritten immediately when entering
this function, so there is no value to retaining it across calls or
BSS-allocating it.