mirror of https://github.com/espruino/BangleApps
adding a few more constellations
parent
d0d1cbea2c
commit
fa0b2c7d08
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("AEGIAAgVPhAWFAAOACyoYNCxQYMCxZjKFxgwKB42ClAwNFw+O9AwNH48u8RhMLpHu9xhMLg0ipwXBokiMQwXKCoIADC5JGHlwWDMI5ICC44wEVI4XCZxBfC8jzKBRAuCC66oIC4K9IwPuoUk90YYJAXIwVCSYR3HC5WBAgYvPCggAFDQoXGwhAIwVIC5cuBoohDeQoXGpwNFEIbDFC4uCaJL1BKQgXDiVEdQdCB4WCYIIACokhC4uEBgYABC4YJII4kuBgZhEBJAXEEwi3EBIhgDwEABwYuHGAoHDgAXDwIXJRwIXKHoaoGC4ZHDC4JgCC4MoUAIXF91CBgReDC4iwCkh3EwNCZwQXFPAgAPCwQXYYIYAOIwYwTCwgwRFwowRCwwwPFw4wPCxAwNFxIYMCxYYKCxpjICp4AQ"))
|
require("heatshrink").decompress(atob("mEwwgkhiIAECp8BCwoABiAWVDBoWKDBgWLMZQuMGBQWNGBAuHjtBGBomHjvRGBhdI7vUMJgLGilE7vdohJHC5MUCoIADDAxGKpoWDJI5ICC44wESJS1IGAR4IJAQXgI4YXJXpAXBoJiBBhEQC5JzCigXTABgXeIBJODC5MdaA4hB6IXLpoNFEIbDFC4zRJboIXJojRC6lEBwdEegXdBIYXDZwIAEeY4ABNgQvEEgfdMIkdBIZTDC4gwELwouGC4MABoyQGHQSCEgAXHSAxSDC7pgDKQJiBL4xcBBIZeBC4cUNIUUC4oJGC4RIEAB4WCC7BgDABxGDGCYWEGCIuFGCIWGGB4uHGB4WIGBouJDBgWLDBQWNMZAVPACAA=="))
|
|
@ -57,10 +57,6 @@ function drawStars(lat,lon,date){
|
||||||
|
|
||||||
|
|
||||||
let starNumber = 0;
|
let starNumber = 0;
|
||||||
//Each star has a number (the position on the file (line number)). These are the lines
|
|
||||||
//joining each star in the constellations.
|
|
||||||
constelation_lines=[/*Orion*/[7,68],[10,53],[53,56],[28,68],/*Taurus*/[13,172],[13,340],[293,340],[29,293],
|
|
||||||
/*canis menor*/[155,8]];
|
|
||||||
var starPositions = {};
|
var starPositions = {};
|
||||||
|
|
||||||
for (i=0;i<f.length;i++)
|
for (i=0;i<f.length;i++)
|
||||||
|
@ -101,17 +97,31 @@ function drawStars(lat,lon,date){
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.constellations){
|
if (settings.constellations){
|
||||||
for (i=0;i<constelation_lines.length;i++)
|
//Each star has a number (the position on the file (line number)). These are the lines
|
||||||
{
|
//joining each star in the constellations.
|
||||||
constelation = constelation_lines[i];
|
constelations=[[[7,68],[10,53],[53,56],[28,68],"Orion"],[[13,172],[13,340],[293,340],[29,293],"Taurus"],
|
||||||
positionStar1=starPositions[constelation[0]];
|
[[155,8],"Canis Menor"],[[36,81],[87,81],[235,87],[33,235],[33,75],[75,40],"Ursa Major"],[[67,91],[74,67],[91,110],[110,252],"Cassiopeia"],[[23,166],[16,294],[294,44],[166,149],[230,149],[16,23],"Gemini"]];
|
||||||
positionStar2=starPositions[constelation[1]];
|
|
||||||
//Both stars need to be visible
|
|
||||||
g.setColor(0,255,0);
|
g.setColor(0,255,0);
|
||||||
|
for (i=0;i<constelations.length;i++)
|
||||||
|
{
|
||||||
|
constelationShowing=false;
|
||||||
|
for (j=0;j<constelations[i].length-1;j++){
|
||||||
|
positionStar1=starPositions[constelations[i][j][0]];
|
||||||
|
positionStar2=starPositions[constelations[i][j][1]];
|
||||||
|
//Both stars need to be visible
|
||||||
if (positionStar1 && positionStar2)
|
if (positionStar1 && positionStar2)
|
||||||
|
{
|
||||||
g.drawLine(positionStar1[0],positionStar1[1],positionStar2[0],positionStar2[1]);
|
g.drawLine(positionStar1[0],positionStar1[1],positionStar2[0],positionStar2[1]);
|
||||||
|
constelationShowing=true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
constelationShowing=false;
|
||||||
g.flip();
|
g.flip();
|
||||||
}
|
}
|
||||||
|
//Write the name
|
||||||
|
if (constelationShowing)
|
||||||
|
g.drawString(constelations[i][constelations[i].length-1],positionStar2[0]+10,positionStar2[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,14 +13,14 @@
|
||||||
1.204,0.288,0.8,Aldebaran
|
1.204,0.288,0.8,Aldebaran
|
||||||
4.317,-0.461,1.0,AL SCO
|
4.317,-0.461,1.0,AL SCO
|
||||||
3.513,-0.195,1.0,AL VIR
|
3.513,-0.195,1.0,AL VIR
|
||||||
2.030,0.489,1.1,BE GEM
|
2.030,0.489,1.1,Pollux
|
||||||
6.011,-0.517,1.2,AL PSA
|
6.011,-0.517,1.2,AL PSA
|
||||||
3.350,-1.042,1.2,BE CRU
|
3.350,-1.042,1.2,BE CRU
|
||||||
5.417,0.790,1.2,Deneb
|
5.417,0.790,1.2,Deneb
|
||||||
3.838,-1.062,1.3,AL2 CEN
|
3.838,-1.062,1.3,AL2 CEN
|
||||||
2.655,0.209,1.4,AL LEO
|
2.655,0.209,1.4,AL LEO
|
||||||
1.827,-0.506,1.5,EP CMA
|
1.827,-0.506,1.5,EP CMA
|
||||||
1.984,0.557,1.6,AL GEM
|
1.984,0.557,1.6,Castor
|
||||||
3.258,-1.101,1.6,AL1 CRU
|
3.258,-1.101,1.6,AL1 CRU
|
||||||
1.984,0.557,1.6,AL GEM
|
1.984,0.557,1.6,AL GEM
|
||||||
3.278,-0.997,1.6,GA CRU
|
3.278,-0.997,1.6,GA CRU
|
||||||
|
|
|
Loading…
Reference in New Issue