Showing posts with label Planets. Show all posts
Showing posts with label Planets. Show all posts

Friday, April 3, 2020

D3-Celestial: Better Planetary Names (and Symbols)

Another extended name feature thanks to Wikipedia: Planetary names in different languages. While at it, I also made the way Solar System bodies are displayed selectable between symbol - how they were displayed until now, letter - The first one or two letters of each body's english name, and disk, a colored circle scaled by apparent magnitude. With the last one I cheated somewhat with the Sun and the Moon so that they don't overwhelm everything else.

The above map shows all the language options for constellations and planets as well as the display options for the latter randomly changing. The relevant new options for planets are:

  planets: {  //Show planet locations, if date-time is set
    show: false,
    // 3-letter designations of all solar system objects that should be displayed
    which: ["sol", "mer", "ven", "ter", "lun", "mar", "jup", "sat", "ura", "nep", "cer", "plu"],
    // Symbols as unicode codepoints, letter abbreviations and colors to be displayed
    symbols: {
      "sol": {symbol: "\u2609", letter:"Su", fill: "#ffff00"},
      "mer": {symbol: "\u263f", letter:"Me", fill: "#cccccc"},
      "ven": {symbol: "\u2640", letter:"V", fill: "#eeeecc"},
      "ter": {symbol: "\u2295", letter:"T", fill: "#00ccff"},
      "lun": {symbol: "\u25cf", letter:"L", fill: "#ffffff"},
      "mar": {symbol: "\u2642", letter:"Ma", fill: "#ff6600"},
      "cer": {symbol: "\u26b3", letter:"C", fill: "#cccccc"},
      "ves": {symbol: "\u26b6", letter:"Ma", fill: "#cccccc"},
      "jup": {symbol: "\u2643", letter:"J", fill: "#ffaa33"},
      "sat": {symbol: "\u2644", letter:"Sa", fill: "#ffdd66"},
      "ura": {symbol: "\u2645", letter:"U", fill: "#66ccff"},
      "nep": {symbol: "\u2646", letter:"N", fill: "#6666ff"},
      "plu": {symbol: "\u2647", letter:"P", fill: "#aaaaaa"},
      "eri": {symbol: "\u26aa", letter:"E", fill: "#eeeeee"}
    },
    // Style options for planetary symbols
    symbolStyle: { fill: "#00ccff", opacity:1, font: "bold 17px 'Lucida Sans Unicode', Consolas, sans-serif", align: "center", baseline: "middle" },
    symbolType: "symbol",  // Type of planetary symbol to be displayed: 'symbol', 'letter' or 'disk'
    names: false,  // Show name next to symbol
    // Style options for planetary names
    nameStyle: { fill: "#00ccff", font: "14px 'Lucida Sans Unicode', Consolas, sans-serif", align: "right", baseline: "top" },
    namesType: "en"  // Language in which the name is displayed, supported options:
    // (desig) 3-Letter-Designation, (ar) Arabic, (cn) Chinese, (en) English, (fr) French, (de) German, (gr) Greek, (il) Hebrew, 
    // (in) Hindi, (it) Italian, (jp) Japanese, (lat) Latin, (ru) Russian, (es) Spanish  
  },

Wednesday, August 30, 2017

D3-Celestial animated planets

Now that I have solar system objects in the interactive d3-celestial map, I can, with only a bit more effort, make a pretty temporal animation with it, loke below.

Apart from including the necessary javascript libraries, this is the code to do that: var reqID, reqAnimFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame, cncAnimFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame || window.oCancelAnimationFrame, dt = new Date(); Celestial.display({ location:true, projection:"equirectangular", datapath: "http://ofrohn.github.io/data/", planets: {show: true}, dsos: {show: false}, constellations: {names: false}, stars: {names: false, limit: 4.6} }); function animate() { reqID = reqAnimFrame(animate); dt.setDate(dt.getDate()+1); Celestial.date(dt); } d3.select('#celestial-map').on('mousedown', function() { cncAnimFrame(reqID) } ) d3.select('#celestial-map').on('mouseup', function() { reqAnimFrame(animate) } ) reqID = reqAnimFrame(animate);

As you can see, most of it is configuration and javascript animation stuff, the essential d3-celestial function needed is Celestial.date(dt) to change the date.

See some more d3-celestial examples here, play with it here or check out the documentation and/or fork/download the source from the GitHub repository.

Wednesday, August 10, 2016

Simulate all the planets

So I was searching for a better simulation framework for my Solar System orrery project, and somebody pointed me to three.js, a WebGL 3D-Library. It looked promising. Now it would be nice to do that with all the planets, and somebody already thought the same. Even better. Of course, while a nice simulation, the models left a little bit to be desired in terms of accuracy, so I tried upon myself to improve that. Well, see the result below for yourself. Click/tap on the buttons at left to select a model, holding down a mouse button will stop the rotation.

The bodies rotate with the same relative speed as their natural brethren, although a wee bit faster in absolute terms. The tilt agains the ecliptic is also equvalent

See some more examples here, all the planets dancing in a circle, Earth and Moon doing their thing. Check out the documentation or fork/download the threex.planets source in the GitHub repository. It also includes all the credits for the image sources.

So I was searching for a better simulation framework for my Solar System orrery project, and somebody pointed me to three.js, a WebGL 3D-Library. It looked promising. Now it would be nice to do that with all the planets, and somebody already thought the same. Even better. Of course, while a nice simulation, the models left a little bit to be desired in terms of accuracy, so I tried upon myself to improve that. Well, see the result below for yourself. Click/tap on the buttons at left to select a model.

See some more examples here, all the planets dancing in a circle, Earth and Moon doing their thing. Check out the documentation or fork/download the planets source in the GitHub repository.

Monday, December 14, 2009

Elongation Charts

[Update: new and improved version here]

I saw this once in an astronomy book when I was little, but haven't encountered these anywhere since then. So I thought it was time to change that.


Click for larger image

What is shown in the chart is the elongation of every planet, that is the angle between the planet's and the Sun's position over time, projected on the ecliptic, for all of 2010. The yellow line in the middle is the position of the sun. So right after sunset the left half of the chart is above the horizon, and just before sunset the right half. In between the window of visiblity shifts out of the left and into the right side at a rate of 15° per hour. Note that the position of the ecliptic in the night sky depends on your location on the ground, but the position of the planets along the ecliptic is the same from every location.

If you know where the ecliptic is from your location, find the current date on the chart, and you know where to expect each of the planets along the ecliptic. When the planet crosses behind the Sun, it is at conjunction, when it crosses over at 180° it is at opposition. For the lower planets Mercury and Venus upper and lower conjunction are shown as the line crossing behind or in front of the Sun. Whew. Was that difficult?

The planet-tracks are color coded and marked with their symbols according to the legend, the linewidths are proportional to the planet's apparent magnitude at the given time. The vertical tickmarks denote weeks, each tick lies on a sunday. The large ticks and white circles on the right side mark full moon dates. For amateur astronomers this might serve as a "stay home"-marker ;).r


Click for larger image

If you are missing Pluto (well, I do), here is a chart with several dwarf-planets included. Be aware, however, that they are much more inclined from the ecliptic than the biggies, and therefore the projection on the ecliptic much less accurate. Also, the are, apart from ceres, much fainter and require some serious instumentation to see them. And thats my justification for not including Pluto on the planets-only chart and I'm sticking to it, even if it hurts me.

Ephemeris data from NASA's HORIZONS database
For may solar system graphics including several spacecraft: JPL Solar System Simulator