Converting a coordinate position (X,Z) to a longitude and latitude?

I’m working on a little tech demo for building real-world terrain on Roblox. However, I need to accurately convert an X, Z coordinate position to a longitude and latitude value, which I honestly have no idea how to do.

I’ve tried searching on Google but have come across nothing of use.
Thanks!

Edit: To make the question more clear, let’s say that the steps I would take to do this would be as follows:

  1. Get distance between current vector2 position (10,10) and the centre of the world (0,0). That would be 10,10
  2. Convert this to meters
  3. Use that to generate a longitude/latitude

I have no idea if that would actually work, at this point, I’m just spitballing ideas.

2 Likes

There is this

But the coords have to contain an X, Y and Z components. Do you just want this for X and Z? I seem to find nothing for that as well. You can’t use 2D coords to convert to longitudes and latitudes it seems like it.

2 Likes

I don’t need the Y component, no. Now that I’m looking at it, I think I could have phrased the question a bit better. The post you linked is referring to a graph where X is across and Y is up. I’m basically talking about the same thing here.

1 Like