Click here to Skip to main content
15,890,527 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralA different website PinPopular
David O'Neil14-May-20 16:39
professionalDavid O'Neil14-May-20 16:39 
GeneralRe: A different website Pin
V.14-May-20 20:32
professionalV.14-May-20 20:32 
GeneralRe: A different website Pin
kalberts14-May-20 23:20
kalberts14-May-20 23:20 
GeneralRe: A different website Pin
Jörgen Andersson15-May-20 1:47
professionalJörgen Andersson15-May-20 1:47 
GeneralRe: A different website Pin
kalberts15-May-20 5:13
kalberts15-May-20 5:13 
GeneralRe: A different website Pin
Jörgen Andersson15-May-20 6:40
professionalJörgen Andersson15-May-20 6:40 
GeneralRe: A different website Pin
kalberts18-May-20 0:27
kalberts18-May-20 0:27 
GeneralRe: A different website Pin
David O'Neil15-May-20 6:39
professionalDavid O'Neil15-May-20 6:39 
Member 7989122 wrote:
You could e.g. watch an animation of any solar eclipse, as it would appear from any place on earth. You could plot the trajectories of any of the planets across the sky. You could generate caldendars containing exact times for any astronomical event for each day, such as sunrise/sunset, equinoxes, eclipses, and lots more.

Much, if not all, of that stuff can be done by the desktop version of Stellarium. Play with it!

Here's a script I developed to look for solar eclipses, to get you started with scripting if you want. In Stellarium, press F12 and copy the following code. Turn the ground off, as well as switch to azimuthal viewing and disable the atmosphere for best experience. (I could have scripted those actions as well, but didn't.) This will spit out dates in the Log View of the F12 window of when eclipses occur.

F10 brings up some astronomic calculations, which may address your last point.
JavaScript
// ******************************************************************************************
// Stellarium script to find the next next solar eclipse, to within specifiable radian
// difference of 'maxDiff'.
//
// Per NASA, Changes in ambient light are generally not noticeable until the sun is more
// than 95 percent covered by the moon.
// (https://www.nasa.gov/feature/goddard/2016/nasa-releases-march-8-total-solar-eclipse-
//  visualizations.)
//
// (If you watch shadow pinlights between tree leaves, you can see the crescent shape
//  of the eclipse at lesser percentages.)
//
// Created by David O'Neil, Aug, 2019. Released to the public domain, for anyone interested.
// Just leave this 'created by' (or 'originally created by') verbage in the derived work.
//
// To use:
//   * Set the date via Stellarium's user interface close to a time you are looking for a
//     solar eclipse to occur.
//   * To go backwards in time, change the 'dayDiff' variable accordingly.
//   * Run the script. It will stop executing when the 'maxDiff' condition is met.
// ******************************************************************************************

//Set the following to "-29 days" to go backwards:
dayDiff = "-29 days";
maxDiff = 0.004;

//Don't change anything below here:
obj1 = "Sun";
obj2 = "Moon";
a1 = 0.0;
a2 = 1.0;
pi = Math.PI;
degToRad = pi/180;

//map=core.getSelectedObjectInfo();
//core.output(core.mapToString(map));

core.selectObjectByName(obj1, true);
StelMovementMgr.setFlagTracking(true);
justFindSeparation = false;
diff = 1.0;
if (justFindSeparation) {
   d = getRadiansBetweenObjects();
   d = d/degToRad;
   degrees = Math.floor(d);
   minutes = d - degrees;
   minutes = minutes * 60;
   seconds = minutes - Math.floor(minutes);
   core.debug(degrees + " " + Math.floor(minutes) + " " + seconds*60);
   }
else {
   while (true) {
      while (diff > maxDiff) {
         findClosestConjunction();
         //core.wait(1);
         diff = getRadiansBetweenObjects();
         //core.debug(core.getDate() + ", Angle Diff: " + diff);
         if (diff >= maxDiff) core.setDate(dayDiff);
         }
      core.debug(core.getDate() + " " + diff);
      core.setDate(dayDiff);
      diff = 1.0;
      }
   // core.debug("Success!");
   // core.debug(core.getDate());
   // core.debug("Angle Diff: " + a2);
   }

function findClosestConjunction() {
   core.selectObjectByName(obj1, true);
   StelMovementMgr.setFlagTracking(true);
   core.setTimeRate(0); //Lock the sky in place, so we can see it unmoving!

   //Get the initial 2 points:
   a1 = getRadiansBetweenObjects();

   //Do initial iteration in 1-day increment:
   a2 = getTheAngleAfter("+1 days");

   direction = "+";
   if (a2 < a1) {
      direction = "+";
      }
   else {
      direction = "-";
      a2 = getTheAngleAfter("-2 days");
      }

   timeStepString = direction + "1 days";

   //Iterate:
   while (a2 < a1) {
      a1 = a2;
      a2 = getTheAngleAfter(timeStepString);
      }

   //Assume we've gone through several days, and have passed the last good one,
   //so step back (or forward) a day to fix the overstep:
   if (direction == "+") {
      a1 = getTheAngleAfter("-1 days");
      }
   else {
      a1 = getTheAngleAfter("+1 days");
      }

   //And the hour intervals. As before, we must check whether we need to
   //go back or forward.

   //Now determine whether to go forward or back:
   a2 = getTheAngleAfter("+1 hour");

   if (a2 < a1) {
      direction = "+";
      }
   else {
      direction = "-";
      a2 = getTheAngleAfter("-2 hours");
      }

   timeStepString = direction + "1 hour";

   while (a2 < a1) {
      a1 = a2;
      a2 = getTheAngleAfter(timeStepString);
      }

   //Assume we've gone through several hours, and have passed the last good one,
   //so step back (or forward) an hour to fix the overstep:
   if (direction == "+") {
      a1 = getTheAngleAfter("-1 hours");
      }
   else {
      a1 = getTheAngleAfter("+1 hours");
      }

   if (a2 > 0.04) return;

   //And the 20 minute intervals:
   //First, set a1 to a2, as a2 was last measurement taken at current time:
   a1 = a2;
   a2 = getTheAngleAfter("+20 minutes");

   if (a2 < a1) {
      direction = "+";
      }
   else {
      direction = "-";
      a2 = getTheAngleAfter("-40 minutes");
      }

   timeStepString = direction + "20 minute";

   while (a2 < a1) {
      a1 = a2;
      a2 = getTheAngleAfter(timeStepString);
      }

   //And the 5 minute intervals:
   //First, set a1 to a2, as a2 was last measurement taken at current time:
   a1 = a2;
   a2 = getTheAngleAfter("+5 minutes");

   if (a2 < a1) {
      direction = "+";
      }
   else {
      direction = "-";
      a2 = getTheAngleAfter("-10 minutes");
      }

   timeStepString = direction + "5 minute";

   while (a2 < a1) {
      a1 = a2;
      a2 = getTheAngleAfter(timeStepString);
      }

   //And finally, for the minutes:
   //First, set a1 to a2, as a2 was last measurement taken at current time:
   a1 = a2;
   a2 = getTheAngleAfter("+1 minutes");

   if (a2 < a1) {
      direction = "+";
      }
   else {
      direction = "-";
      a2 = getTheAngleAfter("-2 minutes");
      }

   timeStepString = direction + "1 minute";

   while (a2 < a1) {
      a1 = a2;
      a2 = getTheAngleAfter(timeStepString);
      }

   }

function getTheAngleAfter(timeStep) {
   obj2Azi = core.getObjectInfo(obj2).azimuth;
   core.setDate(timeStep);
   while (core.getObjectInfo(obj2).azimuth == obj2Azi) {
      core.wait(0.01);
      }
   angleDiff = getRadiansBetweenObjects();
   return angleDiff;
   }

function getRadiansBetweenObjects() {
   obj2Azi = core.getObjectInfo(obj2).elong;
   obj2Azi = obj2Azi * degToRad;
   obj2Alt = core.getObjectInfo(obj2).elat;
   obj2Alt = obj2Alt * degToRad;

   obj1Azi = core.getObjectInfo(obj1).elong;
   obj1Azi = obj1Azi * degToRad;
   obj1Alt = core.getObjectInfo(obj1).elat;
   obj1Alt = obj1Alt * degToRad;

   d = Math.acos(Math.sin(obj2Alt)*Math.sin(obj1Alt)+Math.cos(obj2Alt)*Math.cos(obj1Alt)*Math.cos(obj2Azi-obj1Azi));

   //The following formula is for when the objects are very close together, or very close to 180 degrees apart:
   //I may have Azi and Alt mixed up.

   // delAzi = obj1Azi - obj2Azi;
   // delAlt = obj1Alt - obj2Alt;

   //d = sqrt ( (cos(aziA-aziB) * (altA-altB)) ^2 + (aziA-aziB)^2 )
   //d = Math.sqrt ( Math.cos(delAzi)*(delAlt) * Math.cos(delAzi)*(delAlt) + (delAzi)*(delAzi) );

   return d;   //In radians
   }

GeneralRe: A different website Pin
Mike Hankey15-May-20 3:30
mveMike Hankey15-May-20 3:30 
GeneralRe: A different website (upvoted) Pin
peterkmx15-May-20 8:27
professionalpeterkmx15-May-20 8:27 
GeneralInterview Question asked in 2015 Pin
Amarnath S14-May-20 14:29
professionalAmarnath S14-May-20 14:29 
GeneralRe: Interview Question asked in 2015 Pin
lopatir14-May-20 17:46
lopatir14-May-20 17:46 
GeneralRe: Interview Question asked in 2015 Pin
Super Lloyd14-May-20 18:22
Super Lloyd14-May-20 18:22 
GeneralRe: Interview Question asked in 2015 Pin
Shao Voon Wong14-May-20 19:46
mvaShao Voon Wong14-May-20 19:46 
GeneralRe: Interview Question asked in 2015 Pin
Super Lloyd14-May-20 19:59
Super Lloyd14-May-20 19:59 
GeneralRe: Interview Question asked in 2015 Pin
Richard MacCutchan14-May-20 20:49
mveRichard MacCutchan14-May-20 20:49 
GeneralRe: Interview Question asked in 2015 Pin
Greg Utas15-May-20 0:20
professionalGreg Utas15-May-20 0:20 
GeneralRe: Interview Question asked in 2015 Pin
Richard MacCutchan15-May-20 0:29
mveRichard MacCutchan15-May-20 0:29 
GeneralVideo games and plots Pin
honey the codewitch14-May-20 9:59
mvahoney the codewitch14-May-20 9:59 
GeneralRe: Video games and plots Pin
Sander Rossel14-May-20 11:03
professionalSander Rossel14-May-20 11:03 
GeneralRe: Video games and plots Pin
honey the codewitch14-May-20 11:19
mvahoney the codewitch14-May-20 11:19 
GeneralRe: Video games and plots Pin
Eddy Vluggen14-May-20 11:43
professionalEddy Vluggen14-May-20 11:43 
GeneralRe: Video games and plots Pin
honey the codewitch14-May-20 12:50
mvahoney the codewitch14-May-20 12:50 
GeneralRe: Video games and plots Pin
Eddy Vluggen14-May-20 13:29
professionalEddy Vluggen14-May-20 13:29 
GeneralRe: Video games and plots Pin
honey the codewitch14-May-20 14:25
mvahoney the codewitch14-May-20 14:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.