1
I’m trying to use a formula that gives me the expected result in C#, when translating the code to VB.NET the result is completely different.
I’m almost sure I did the translation correctly. I forgot something?
Formula in C#:
double x = 199025 / (double)(1 << 19) * 360.0 - 180;
// Resultado: -43.3403778076172
Link to test online: https://onlinegdb.com/uUuQD8kMG
Formula in VB.NET:
Dim x as Double = 199025 / CType((1 << 19) * 360.0 - 180, Double)
// Resultado: 0.00105447339908394
Link to test online: https://onlinegdb.com/02c5RaQTP
different code = different results :) just out of curiosity, how did you get into this? is validating the framework? ;)
– Ricardo Pontual
If you’re talking about the formula, I took it off the Openstreetmaps website to convert the X coordinate to Longitude. https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#C.23
– Natan Fernandes
legal, thanks for the information
– Ricardo Pontual