Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Elevation Column #189

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formatting
  • Loading branch information
V999TEC committed Jul 11, 2022
commit 662daf56a1ab4fefdca011262449369684ad9e56
48 changes: 1 addition & 47 deletions public_html/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,89 +20,43 @@ var UnitLabels = {


////

function format_elevation(siteAltFeet, siteDistMetres, altitudeFeet) {



var ftHeight = 'ground' == altitudeFeet ? 0 : altitudeFeet;



if( ftHeight < 0 ) {



return 93; // it happens

}



if( null == siteDistMetres) {



return 92; // invalid angle

}



if( null == altitudeFeet ) {



return 91; // invalid angle

}



if( 0 == siteDistMetres ) { // craft overhead



return 90;

}



var ftDistance = siteDistMetres*3.28084;

var ftDiff = ftHeight - siteAltFeet;



// make approximation for 2 * Earth radius in ft
// make approximation for 2 * Earth radius in ft

var radiansAngularDrop = ftDistance / 41784593;

var radians = ftDiff / ftDistance;



var elevAngleRadians = Math.atan( radians - radiansAngularDrop);



var elevAngleDegrees = 57.29577951308232 * elevAngleRadians;



var result = Math.round( 1000*elevAngleDegrees) / 1000;



var result3dp = Number.parseFloat(result).toFixed(3);



return result3dp;

}

////


Expand Down
8 changes: 0 additions & 8 deletions public_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@

<div id="settings_infoblock">
<div id="settings_close" class="settingsCloseBox"></div>

<div>
<div class="settingsColumn">

<div id="units_container">
<label for="units_selector"><span class="infoBlockTitleText">Units:</span></label>
<select name="units_selector" id="units_selector">
Expand All @@ -111,11 +109,8 @@
<option value="imperial">Imperial</option>
</select>
</div>

</div>

<div class="settingsColumn">

<div id="elevation_container">
<form id="elevation_form">
<div class="elevationOptions">
Expand All @@ -127,11 +122,8 @@
</div>
</form>
</div>

</div>

</div>

<div class="settingsColumn">
<div class="settingsOptionContainer">
<div class="infoBlockTitleText">Overlay Toggles</div>
Expand Down
39 changes: 11 additions & 28 deletions public_html/planeObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function PlaneObject(icao) {
// Info about the plane

this.count = 0; ////
this.count = 0; ////

this.icao = icao;
this.icaorange = findICAORange(icao);
Expand Down Expand Up @@ -351,38 +351,21 @@ PlaneObject.prototype.getMarkerColor = function() {
if (this.squawk in SpecialSquawks)
return SpecialSquawks[this.squawk].markerColor;


////

this.count ++;


////
this.count ++;

for( let index=0; index < SpecialElevations.length; index++) {

if( this.elevation < SpecialElevations[index].exceptional ) {

if( 0 == parseInt(this.count)%2 ) {

if( this.elevation < SpecialElevations[index].exceptional ) {



if( 0 == parseInt(this.count)%2 ) {



return SpecialElevations[index].markerColor;

}



break;

}

}

////
return SpecialElevations[index].markerColor;
}
break;
}
}
////

var h, s, l;

Expand Down
Loading