Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiorosa1 authored Mar 18, 2019
1 parent 890e482 commit 7faf623
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Intermediate Algorithm Scripting/map-the-debris.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"index.js":"function orbitalPeriod(arr) {\n var GM = 398600.4418;\n var earthRadius = 6367.4447;\n let newArr = [];\n // implement the conversion formula \n for(let avg in arr){\n let T = Math.round(2*Math.PI* Math.sqrt(Math.pow(earthRadius + arr[avg].avgAlt,3)/GM));\n // create the object with the specifications\n let newObj = {\n name: arr[avg].name,\n orbitalPeriod: T\n };\n // push it into a new array\n newArr.push(newObj);\n }\n \n return newArr;\n}\n\norbitalPeriod([{name : \"sputnik\", avgAlt : 35873.5553}]);"}

0 comments on commit 7faf623

Please sign in to comment.