I noticed the returned point is not exactly at 90 degrees from the input, i.e. the latitude changes.
I'll create an additional test in @turf/destination to highlight the error.
馃憤 Thanks for reporting this @stebogit, however I believe this might be an expected result from the Haversine Formula referenced in http://www.movable-type.co.uk/scripts/latlong.html.
It would be still good to provide some test fixtures regardless of the known or not known issue.
@DenisCarriere what do you think? I guess the behaviour might be unexpected to an unaware user (like me), but in fact correct.
Gday @stebogit
Perhaps we just add a short note to the doco for the module that the visual output might look slightly misaligned due to the curvature of the earth, im sure someone can come up with some slightly more accurate words than those.
I'm still baffled by this issue, regardless of the Haversine Formula taking into account the curvature of the earth, one would assume by using bearing=90 your destination point result should be at the same latitude (degrees or meters).
Let's keep this issue open until we find a solution (or give up the issue and accept the curvature of the earth distortion effect).
@DenisCarriere after some research I found out the reason why this module returns an unexpected output is that it follows a great-circle distance to take in account the earth curvature, while somebody working on a 2D map would actually expect a movement along a Rhumb line.
geodesy is a great library that implements different methods along those lines.
I'd be happy to implement like @turf/rhumb-destination, @turf/rhumb-distance and @turf/rhumb-bearing modules using that library, or maybe taking cues from it, as I believe it might result in a not lightweight dependency
cc: @rowanwins
A module like @turf/rhumb-destination would probably also "solve" #684, as it would properly move a point of the exact/expected distance.
馃憤 @stebogit Sounds like a plan.
I like your module naming convention
rhumb-<method>
@turf/rhumb-destination with bearing=90 returns the expected result (a destination point at the same latitude) on a map, as a Rhumb Line is a straight line on a Mercator projection
馃憤 Woohoo 馃帀