add xy midpoint computation to lattice