Storing /locate results

OK, so I tried to store the results of a /locate command in storage in various forms, but it just takes the distance the structure is from the player, rather than the coordinates. I was wondering if there's any way to store the coordinates instead? I want to give the player a compass that points to a random nearby structure.

If I have to pull out some crazy trigonometry to figure out where it is from 2 /locate commands, I can try that too... Though I would rather not...

Continue to help post