ofrohn / d3-celestial

A star map with d3.js
BSD 3-Clause "New" or "Revised" License
631 stars 179 forks source link

Find out the constellation a celestial body is in #108

Closed constellator closed 3 years ago

constellator commented 3 years ago

Does anyone know of an algorithm that would read the constellation boundaries (constellations.bounds.json) and return the constellation a celestial body is in (given its right ascension and declination)? Thanks in advance!

constellator commented 3 years ago

I realized it's the problem of finding a point inside a polygon. I'm checking the code at http://csharphelper.com/blog/2014/07/determine-whether-a-point-is-inside-a-polygon-in-c/#:~:text=For%20example%2C%20if%20the%20point,zero%2C%20the%20point%20is%20outside.