How do I convert world space Vector3s to terrain based coordinates on the [256,256] scale?

said what i mean, really looking for an explanation not a link, seen everything on this I think.

Subtract position of terrain from your world space position, then divide x and z coordinates by size of terrain (256x256 in this case). Any value less than 0 or greater than 1 will mean that the coordinate is outside of your terrain.