Calculating lengths of supporting rods