Skip to content

Conversation

@Th3stral
Copy link

@Th3stral Th3stral commented Apr 8, 2025

In the calculateNewPos() method of UtilFunctions class.

The constant DEGREE_IN_M should be adjusted by $$\times \cos(\phi)$$ — since as latitude ($$\phi$$) increases, the longitudinal distance per degree decreases proportionally to cos(φ).

In the original code:

double newLongitude=initialLocation.longitude+(pdrMoved[0]/(DEGREE_IN_M))*Math.cos(Math.toRadians(initialLocation.latitude));

the brackets were misplaced, applying the correction as: DEGREE_IN_M$$\div \cos(\phi)$$.
This is incorrect and results in overcompensation at higher latitudes, causing a substantial amount of translation error.

This pull request corrects the equation by properly applying the cosine adjustment in the denominator. The updated code ensures the correction factor is applied as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant