Calculate with lengths

Try something from this thread? You need to account for the units of measurement.