cpp-geometry-library icon indicating copy to clipboard operation
cpp-geometry-library copied to clipboard

computeOffset testcase seem to be fail.

Open BorisLok opened this issue 3 years ago • 0 comments

I did some testing accroding to your code, but the result came out to be failed (as below).

EXPECT_NEAR_LatLan(down,  SphericalUtil::computeOffset(front, M_PI * MathUtil::EARTH_RADIUS / 2, 180));

I tested the "compute offset" function in Javascript version and got the same answser LatLng(lat: -90, lng: 63.43494882292201) as your output. So I think the answser shoud be LatLng(lat: -90, lng: 63.43494882292201) and not LatLng(lat: -90, lng: 0).

import { SphericalUtil, MathUtil} from "node-geometry-library";

let ans = SphericalUtil.computeOffset({ lat: 0, lng: 0 }, Math.PI * MathUtil.EARTH_RADIUS / 2.0, 180);

BorisLok avatar Apr 30 '21 10:04 BorisLok