Measure the distance in whatever units are most convenient, doesn’t matter which. Then you should know the number of base pairs in each band of the ladder. This could be anything from 50 to tens of thousands of base pairs depending on the specific ladder you’re using. Take the log of each length of base pairs. For example, if the band has 1×10^3 bp, the log is 3. Plot distance moved on the x-axis and log(bp) on the y-axis and you should get a decent straight line. To estimate the length of an unknown, measure the distance the unknown moved, find the log(bp) this corresponds to, take the antilog of that number and you have an estimate for the unknown length in bp.