-
Notifications
You must be signed in to change notification settings - Fork 5
experimental UnitSpherical module that can express geometry on unit sphere #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: as/trees
Are you sure you want to change the base?
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3d14dc5
to
6118f5e
Compare
16cf9b4
to
00ff75c
Compare
1f5fba2
to
f33c8e4
Compare
For this to work well, we'll probably want to port a lot of the stuff from s2, like https://github.com/google/s2geometry/blob/58de4ea1e2f8a294e0c072c602c22232fd1433ad/src/s2/s1chord_angle.h - it's Apache 2.0 licensed so we can directly port it. They have a good framework to handle this stuff, so if we can get the basics sorted then we're mostly there I believe. That would also be a good foundation to build an s2 indexing framework in Julia, since we would have all the basic components already. |
TL;DR
Wrote a new
UnitSpherical.jl
module (experimental) for working with points on the unit sphere and spherical caps.What changed?
Created a new file
UnitSpherical.jl
that implements:UnitSphericalPoint
struct for representing points on the unit sphere (S²) using Cartesian coordinates in ℝ³SphericalCap
struct for representing spherical capsspherical_distance
for calculating distances between pointsslerp
for spherical linear interpolationcircumcenter_on_unit_sphere
for finding the center of a circle passing through three points: still brokenangle_between
for calculating angles between pointsrandsphere
for generating random points on the unit sphereQuick start
Import the module and create unit spherical points:
Test spherical caps and operations:
Generate random points on the sphere:
This should provide a nice foundation to start looking at R-trees that are backed by spherical caps, not extents, in preparation for @meggart's work involving this. With the new changes to
as/trees
SpatialTreeInterface is now representation agnostic, meaning that as long as the predicate you passed in can consume the extent like object you have chosen, any extent like thing (accessible bySpatialTreeInterface.node_extent
) can be used by the STI algorithms.