# Math/logic behind (reverse) Wherigo/logic

Followers 2

## Recommended Posts

I am interested in the logic that is used for creating a (reverse) Wherigo, but I cannot seem to find it anywhere. So I am not looking for an existing tool to create a cartridge or the cartridges themselves, just the maths behind it. Does anyone know how it works or a place where I could find an explanation?

Merino

##### Link to comment

There are some sites that take the three strings and compute the coordinates.  If they do so in JavaScript, you could look at that.

##### Link to comment

Is there any more math to it than just the standard "I'm here, how far is it to there?" that's fundamental to all geocaching?

##### Link to comment

I suppose that you might be looking for the Haversine formula, which is used to find the great-circle distance between two points. Over large distances, however, haversine can be up to 0.5% off, due to the fact that it assumes a spherical Earth. If you also want to account for the equatorial bulge of the Earth, try Vincenty's formulae, which generalize to spheroids.

If you're specifically looking to build a reverse Wherigo, you can use the Wherigo.VectorToPoint function, which is an implementation of haversine (on most devices.)

Edited by Hügh
##### Link to comment

The standard 'reverse Wherigo' with the three numbers is actually a very simple function. All the coordinate digits are in the numbers, just mixed up. You can either deduce the algorithm used to 'decode' the coordinates, or if you can decompile the source Wherigo just reverse engineer the function.  When it was first released I managed to figure out the pattern and write my own quick little decoder with the numbers. Now there's a very popular site that people use to get it quick.  Last I checked there was no math, just shuffling.

Edited by thebruce0
• 1
• 1
##### Link to comment
1 hour ago, thebruce0 said:

The standard 'reverse Wherigo' with the three numbers is actually a very simple function. All the coordinate digits are in the numbers, just mixed up. You can either deduce the algorithm used to 'decode' the coordinates, or if you can decompile the source Wherigo just reverse engineer the function.  When it was first released I managed to figure out the pattern and write my own quick little decoder with the numbers. Now there's a very popular site that people use to get it quick.  Last I checked there was no math, just shuffling.

I wish it were that simple. I checked by converting a set of coords and then do a digits frequency analysis of both sets. Not even close, so there must be more to it than just shuffling.

##### Link to comment
2 hours ago, Merino said:

I wish it were that simple. I checked by converting a set of coords and then do a digits frequency analysis of both sets. Not even close, so there must be more to it than just shuffling.

...if you are referring to Waldmeister's Reverse Wherigo cartridge, then it is just a shuffling of the digits. However, it operates using decimal degrees, not degrees decimal minutes. If you're having trouble, I'm happy to discuss (in private.)

Edited by Hügh
##### Link to comment

Does anyone know how the check digits are calculated? (third digit in the second and third lines)

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.