3
$\begingroup$

What is a reasonable way to code the title question in Mathematica? Trying the following gave Polygons over GeoPositions over Lists of pairs, but just digging into these seemed inelegant. Besides, there may be a more general way than what I've guessed below.

Also, is there a better way of searching for Solar Eclipses over a given time frame than what I've ventured below? Many thanks.

SolarEclipse[{DateObject[{2010, 1, 1, 0, 0}], 
  DateObject[{2030, 1, 1, 0, 0}], All}, "TotalPhasePolygon", 
 EclipseType -> "Total"]
$\endgroup$
1
  • $\begingroup$ This is a great question, and I'm glad you got an answer. Mathematica is certainly sometimes a very cool program indeed! Several times I have been amazed at the kind of thing it's possible to make it do and using only a very few lines of code. $\endgroup$
    – user59886
    Commented Apr 12, 2022 at 11:10

1 Answer 1

3
$\begingroup$

There really is no need to dig too much into the data. With your list of eclipses

ec = SolarEclipse[{DateObject[{2010, 1, 1, 0, 0}], DateObject[{2030, 1, 1, 0, 0}], All}, "TotalPhasePolygon", EclipseType -> "Total"];

Define

NextEclipse[loc_] := MinimalBy[ec, Min@GeoDistance[#, loc] &]

and then for example

NextEclipse@FindGeoLocation["Paris"]

shows there's one total solar eclipse over Paris on Aug 12, 2026.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.