Jump to content

Easting and Northing


Recommended Posts

How can I go about accessing a vessel's easting and northing values (I'd like surface coordinates of a vessel, in meters)? GetWorldPos3D() was giving me really weird inconsistent values, and I couldn't figure out exactly what x,y,z were. Help greatly appreciated.

Link to comment
Share on other sites

Surface coordinates aren't usually measured in meters, since "meters" can be tricky to map onto a sphere. A common way to specify a coordinate is using latitude and longitude. Vessel exposes both of those values.

There are a bunch of ways to work with those values. CelestialBody has a number of methods that take lat, long & altitude as input, e.g. to surface positions relative to the planet or relative to KSPs current reference frame (thats what GetWorldPos3D should give your). You could even do stuff manually... if you don't mind the math involved

Link to comment
Share on other sites

Kind of curious why you would want easting and northing instead of lat/lon. But as Faark said, you can easily get Lat/Lon from a vessel, and then determine the distance to that point from whatever reference you're using. As easting/northing is a relative coordinate system instead of an absolute one, you would need to define reference points to base those measurements on. I suppose you could just use N0 E0, but that would get you to some really big values. Otherwise, you would have to define your own grid like the UTM grid. Then you can find the distances using a couple of methods. Here is my favorite page covering a lot of lat/lon distances. You could either find the great circle distance between your reference and given location, and then use the heading and do some simple trig to get the base and height of the triangle, or you could just run that formula twice using the corner points (ref lat, ref lon) to (point lat, ref lon) and (ref lat, ref lon) to (ref lat, point lon) to get the eastings and northings directly.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...