small piece of C software to calculate the wallroughness of a laser scan