High-precision nanoscale length measurement