Welcome, Guest. Please Login.
Gravity Simulator
02/21/18 at 02:50:35
News: Registration for new users has been disabled to discourage spam. If you would like to join the forum please send me an email with your desired screen name to tony at gravitysimulator dot com.
Home Help Search Login


1  General / Discussion / Re: Autopilot in the browser version
 on: 12/20/17 at 13:49:42 
Started by Tony | Post by Tony
distance, speed, date UTC
Place in Per Graphic Update Autopilot
 
Code:
var d = UTC(elapsedTime * 1000 + startDate);
var arrd = d.split(" ");
var arrd2 = arrd[4].split(":");
d = (distance(4,12)/LD).toFixed(3) + " LD &nbsp&nbsp&nbsp";
d += (speed(4,12)/1000).toFixed(3) + " km/s&nbsp&nbsp&nbsp";
d = d + arrd[1]; //Month
d = d + " " + arrd[2]; //Date
d = d + ", " + arrd[3]; //Year
d = d + " " + arrd2[0]; //Hour
d = d + ":" + arrd2[1]; //colon and minute
d = d + ":" + arrd2[2]; //colon and second
d = d + " UTC";
divInBlank.innerHTML = d;  
 

Reply Quote Notify of replies  

2  General / Discussion / Re: Autopilot in the browser version
 on: 11/27/17 at 18:04:20 
Started by Tony | Post by Tony
Make the divInBlank display a table of distances and speeds.
Add this to the Autopilot per graphics updates.
Code:
divInBlank.innerHTML = "<table style='text-align:right'><tr><td></td><td>AU</td><td>km/s</td></tr><tr><td>Pioneer 10</td><td>&nbsp&nbsp" +(distance(1,12)/AU).toFixed(2)+ "</td><td>&nbsp&nbsp" + (speed(1,12)/1000).toFixed(3)+"</td></tr><tr><td>Pioneer 11</td><td>&nbsp&nbsp" +(distance(1,13)/AU).toFixed(2)+ "</td><td>&nbsp&nbsp"+ (speed(1,13)/1000).toFixed(3)+"</td></tr><tr><td>Voyager 1</td><td>&nbsp&nbsp" +(distance(1,14)/AU).toFixed(2)+ "</td><td>&nbsp&nbsp"+ (speed(1,14)/1000).toFixed(3)+"</td></tr><tr><td>Voyager 2</td><td>&nbsp&nbsp" +(distance(1,15)/AU).toFixed(2)+ "</td><td>&nbsp&nbsp"+ (speed(1,15)/1000).toFixed(3)+"</td></tr><tr><td>New Horizons</td><td>&nbsp&nbsp" +(distance(1,16)/AU).toFixed(2)+ "</td><td>&nbsp&nbsp"+ (speed(1,16)/1000).toFixed(3)+"</td></tr><tr><td>Oumuamua</td><td>&nbsp&nbsp" +(distance(1,17)/AU).toFixed(2)+ "</td><td>&nbsp&nbsp"+ (speed(1,17)/1000).toFixed(3)+"</td></tr></table>";

 

Reply Quote Notify of replies  

3  General / Discussion / Re: Autopilot in the browser version
 on: 11/18/17 at 14:22:48 
Started by Tony | Post by Tony
Here is a way to make a customized, borderless, draggable date.
In the menu Autopilot > Now textbox paste the following and hit Update.
Code:
lblBlankTitle.style.visibility = 'hidden';
btnBlankClose.style.visibility = 'hidden';
divBlank.style.backgroundColor = 'rgba(0,0,255,0.0)'; 
divBlank.style.border = 'none';

divInBlank.style.width = '300px';
divInBlank.style.color = '#FFFF00';
divInBlank.style.fontSize = '20px';
divInBlank.style.fontFamily = 'Arial';
 


You can customize the font size, font color, and font.
Courier is a good font for tables of numbers because all characters are the same size.
 
In the menu Autopilot > Per graphic update textbox paste the following and press Update:
Code:
var d = UTC(elapsedTime * 1000 + startDate);
var arrd = d.split(" ");
var arrd2 = arrd[4].split(":");
d = '';
d = d + arrd[1]; //Month
d = d + " " + arrd[2]; //Date
d = d + " " + arrd[3]; //Year
d = d + " " + arrd2[0]; //Hour
d = d + ":" + arrd2[1]; //colon and minute
d = d + ":" + arrd2[2]; //colon and second
d = d + " UTC";
divInBlank.innerHTML = d;  


Note that you can remove lines of code if for example you don't want to display the minutes and seconds.
You can rearrange the lines of code if you prefer a different date format, for example, Year first.
Reply Quote Notify of replies  

4  General / Discussion / Re: Autopilot in the browser version
 on: 11/18/17 at 14:00:32 
Started by Tony | Post by Tony
In the Display menu is a choice called "Blank". It gives you a blank, unused interface that you can customize if you know a little HTML and Javascript.
 
Open the blank interface: menu Display > Blank
Open the Autopilot Now: menu Autopilot > Now
 
You can give the interface a name:
Enter the following into the Autopilot Now textarea and press Update.
Code:
lblBlankTitle.innerHTML = 'My Custom Div'; 


 
If you don't want your interface to have a title bar, use this line of code:
Code:
lblBlankTitle.style.visibility = 'hidden';
 


If you don't want your interface to have a close button, use this line of code:
Code:
btnBlankClose.style.visibility = 'hidden';
 


You can change the background color and opacity if your div with this line of code:
Code:
divBlank.style.backgroundColor = 'rgba(0,0,255,0.0)'; 
 

Setting the opacity to 0.0 means it will be transparent.
 
If you don't want your interface to have a border, use this line of code:
Code:
divBlank.style.border = 'none';
 


If you don't want your interface to be draggable, use this line of code (make sure to position it where you want it first!):
Code:
$("#divBlank").draggable({ disabled: true});
 


Your interface has a div (short for division. Basically a group of controls) inside it called divInBlank. Using this prevents you from messing up the title bar, borders, and close button. If you've eliminated your borders, title bar, close button, you don't have to use divInBlank. You can simply use divBlank instead.
 
Let's make an interface that give the user a text area where they can set the mass of the Sun in Solar masses, and a button that applies this change:
Code:
lblBlankTitle.innerHTML = "Set Sun's mass";
divInBlank.innerHTML = "<input type = 'text' id = 'txtSunMass' value = 1><br><input type = 'button' value = 'Apply' onclick = 'objMass[1] =Number(txtSunMass.value) * 332946.050894783;'>"; 


The line divInBlank.innerHTML lets you set the HTML inside this div. Don't press enter when typing this code. It has to be all one line. It can be as long as you like, but it has to be all one line.
Reply Quote Notify of replies  

5  General / Discussion / Re: Autopilot in the browser version
 on: 11/06/17 at 09:51:18 
Started by Tony | Post by Tony
This turns off the border and makes the background transparent for the date interface.
Put it in the Autopilot Now box.
Note: this hides the close button. To get it back you have to do btnCalendarDateUTCClose.style.visibility = 'visible';
 
Code:
lblCalendarUTC.style.visibility = 'hidden';
btnCalendarDateUTCClose.style.visibility = 'hidden';
divCalendarDateUTC.style.backgroundColor = 'rgba(0,0,255,0.0)'; 
divCalendarDateUTC.style.border = 'none';
 

Reply Quote Notify of replies  

6  General / Discussion / Re: Autopilot in the browser version
 on: 11/01/17 at 17:46:08 
Started by Tony | Post by Tony
Place Camera B at a certain RA and Dec (one time or per graphic update)
Code:
var RA = 18 + 36/60 + 56/3600;
var Dec = 38+47/60;

Dec = Math.PI * Dec / 180;
RA = Math.PI * RA / 12;
var d = 1e20;
var c = objects + 2;

var e = Math.PI * 23.4392810833333 / 180;

var xEq = Math.cos(RA) * Math.cos(Dec);
var yEq = Math.sin(RA) * Math.cos(Dec);
var zEq = Math.sin(Dec);

unitVectorVelocityX = xEq;
unitVectorVelocityY = Math.cos(e) * yEq + Math.sin(e) * zEq;
unitVectorVelocityZ = -Math.sin(e) * yEq +Math.cos(e) * zEq;
distance = 5e20;

objx[c] = distance * unitVectorVelocityX;
objy[c] = distance * unitVectorVelocityY;
objz[c] = distance * unitVectorVelocityZ;
objvx[c] = 0;
objvy[c] = 0;
objvz[c] = 0;
 


Reply Quote Notify of replies  

7  General / Discussion / Re: Galileo saw Neptune
 on: 10/15/17 at 15:08:25 
Started by frankuitaalst | Post by Tony
Thanks Frank. I forgot we had this thread. I'm glad to see that the two models agree with each other.
Reply Quote Notify of replies  

8  General / Discussion / Galileo saw Neptune - simulation with html
 on: 10/15/17 at 11:58:56 
Started by frankuitaalst | Post by frankuitaalst

Using the new html simulator Tony got this :  
 
http://orbitsimulator.com/gravitySimulatorCloud/simulations/1508018576963_Galile o%20observes%20Neptune.html
Reply Quote Notify of replies  

9  General / Discussion / Re: 2012 TC4
 on: 10/12/17 at 12:56:54 
Started by frankuitaalst | Post by Tony
Thanks for that!
The Daily Express used a still shot of the animation to announce that the asteroid "could smash into the MOON".  
http://www.express.co.uk/news/science/864681/asteroid-2012-tc4-belt-flight-path- destroy-earth-moon
Reply Quote Notify of replies  

10  General / Discussion / 2012 TC4
 on: 10/12/17 at 10:56:40 
Started by frankuitaalst | Post by frankuitaalst
Hello Tony ,
 
Just to let know your animation  of 2012TC4 is on local media via Wiki Commons  
 
https://www.vrt.be/vrtnws/nl/2017/10/12/asteroide-zoeft-langs-de-aarde--nasa-tes t-waarschuwingssysteem/
 
 
Congrats !
Reply Quote Notify of replies