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

Fix tangent projection#34

Open
andrewtapay wants to merge 1 commit into
sidewalklabs:masterfrom
andrewtapay:fix-tan-proj
Open

Fix tangent projection#34
andrewtapay wants to merge 1 commit into
sidewalklabs:masterfrom
andrewtapay:fix-tan-proj

Conversation

@andrewtapay

@andrewtapay andrewtapay commented Apr 23, 2018

Copy link
Copy Markdown

I think there's a typo in the helper function CellId.uv_to_st in the case that CellId.PROJECTION == 1 (the tangent projection). To wit: this should be an increasing function that maps [-1, 1] to [0, 1], and in the default case it does. For example:

>>> import s2sphere
>>> s2sphere.CellId.uv_to_st(-1)
0.0
>>> s2sphere.CellId.uv_to_st(1)
1.0
>>>

However, if we use the tangent projection, this isn't the case:

>>> s2sphere.CellId.PROJECTION = 1
>>> s2sphere.CellId.uv_to_st(-1)
-0.39269908169872414
>>>

I think this PR resolves the issue. Indeed, this function now matches the analogous function in the original C++ library.


This change is Reviewable

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant