Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[core] Precision loss in Transform::flyTo #4298

Closed

Description

@brunoabinader

Transform::flyTo loses more precision than Transform::easeTo when animating. Example:

Given point A LatLng { -45, -135 } and point B LatLng { 45, 135 }:
Transform::easeTo from point A to B: LatLng { 44.999999999695532, 135.00000000038369 }

  • Latitude precision loss: 45 - 44.999999999695532 = 3.0446756E-10
  • Longitude precision loss: 135 - 135.00000000038369 = -3.8369308E-10

Transform::flyTo from point B to A: LatLng { -44.999808628745399, -135.00024116863571 }

  • Latitude precision loss: -45 + 44.999808628745399 = -1.9137125E-4
  • Longitude precision loss: -135 + 135.00024116863571 = 2.4116863E-4

The exponent of precision loss from easeTo is -10, while flyTo is -4.

/cc @1ec5

Activity

  1. 1ec5 commented on Mar 13, 2016

    @1ec5
    Contributor

    This regression was caused by the additional point-latLng-point round trip added in #3301. I wonder how GL JS gets better precision out of that approach.

  2. added
    Core
    on May 30, 2017
  3. jfirebaugh commented on Jun 7, 2017

    @jfirebaugh
    Contributor

    From #9199:

    Finally, the point interpolation is tweaked so that at the end of the flying (when k === 1) it ends up at the exact end point. I didn't see any bugs related to this, but it seems like a good thing to have explicitly.

    This changes the consequences of this bug: instead of ending up at the slightly wrong position at the end of flyTo, it animates to the wrong position, then suddenly snaps to the correct position at the very end.

  4. added
    archived
    on Nov 6, 2018
  5. stale commented on Nov 30, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  6. removed
    archived
    on Dec 3, 2018
  7. added
    archived
    on Jun 1, 2019
  8. stale commented on Jun 2, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  9. removed
    archived
    on Jun 3, 2019
  10. brunoabinader commented on Jun 4, 2019

    @brunoabinader
    ContributorAuthor

    I guess one way to alleviate this issue would be converting the geographical coordinate all the way into tile coordinates, and keep using that when interpolating.

    To be honest, I'd love to see easeTo and flyTo outside of the GL Native core code, and implemented externally as part of a client-side animation interface. /cc @tmpsantos

  11. added
    archived
    on Dec 1, 2019
  12. stale commented on Dec 1, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corearchivedbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions