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$
2
$\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, privacy policy and cookie policy

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