A mathematical technique for the precision determination of lattice parameters