Jump to content

MAFMan's spherical trig calculator


MAFman

Recommended Posts

You can take a look at the haversine formula's for starters. The shortest distance might not be what you want to aim for, as you will likely end up with recalculating your bearing all the time (a course following a great circle rarely ever has a constant bearing).

A loxodrome will give you a constant bearing, which is easier to navigate by (but a longer route. However, getting where you want to be trumps never arriving as you get lost, even if the route is shorter). A loxodrome is a straight line on a Mercator projection, by the way; which is why it's popular with seafarers. As a result it's a popular projection despite its shortcomings on size and shape.

Link to comment
Share on other sites

  • 4 weeks later...

I was thinking of pulling a heightmap directly from the game and using A* to search through it, using the brightness per pixel (height) and the change in altitude over the change in coordinates as a heuristic, as well as arbitrarily assigning infinite cost to points in the ocean. Currently, I have the HeightMapExtractor mod working on pulling a 32K heightmap (which it's been working on for the last two days...).

Link to comment
Share on other sites

As far as I know, pixels on the height map translate to lattitude/longitude. So you have to keep in mind that a pixel around 0° lattitude covers a lot more distance than a pixel around 90­° lattitude.

But it’s not a bad idea to use it as a starting base and worry about those issues later once you have something working.

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...