<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Mages</title>
    <description>The latest articles on DEV Community by Alex Mages (@awmages).</description>
    <link>https://dev.to/awmages</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F448675%2Facc40fce-c5f2-4fd7-b960-56691eae42a2.jpg</url>
      <title>DEV Community: Alex Mages</title>
      <link>https://dev.to/awmages</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/awmages"/>
    <language>en</language>
    <item>
      <title>Hertzbel, JavaScript's First Frequency and Decibel Conversion Library</title>
      <dc:creator>Alex Mages</dc:creator>
      <pubDate>Fri, 21 Aug 2020 15:21:31 +0000</pubDate>
      <link>https://dev.to/awmages/hertzbel-javascript-s-first-frequency-and-decibel-conversion-library-m50</link>
      <guid>https://dev.to/awmages/hertzbel-javascript-s-first-frequency-and-decibel-conversion-library-m50</guid>
      <description>&lt;p&gt;A few weeks ago, my company started working on a new project for the satellite communications market. While I looked over user stories and tech requirements, I realized that there were no useful JavaScript libraries built to handle frequency conversions or decibel calculations.&lt;/p&gt;

&lt;p&gt;I quickly set out to make an all-in-one library that my company, my industry, and general users can call from to handle all those tricky (and sometimes painful) decibel and frequency calculations. Thus I present Hertzbel, JavaScript's first frequency, and decibel conversion library.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Negatronic" rel="noopener noreferrer"&gt;
        Negatronic
      &lt;/a&gt; / &lt;a href="https://github.com/Negatronic/hertzbel" rel="noopener noreferrer"&gt;
        hertzbel
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;hertzbel&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6f671dac451f6d75b464a61325a1765b9b08fc8cd896d794ee38b6d149d06203/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f686572747a62656c"&gt;&lt;img src="https://camo.githubusercontent.com/6f671dac451f6d75b464a61325a1765b9b08fc8cd896d794ee38b6d149d06203/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f686572747a62656c" alt="npm"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/4eba509b648df571a529f023329ad963c3609837cbc394d39048c5f8851f5dfa/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64772f686572747a62656c"&gt;&lt;img src="https://camo.githubusercontent.com/4eba509b648df571a529f023329ad963c3609837cbc394d39048c5f8851f5dfa/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64772f686572747a62656c" alt="npm"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/0de042a9e4100bed48f474f3358dba70130d7ec7ddb3fa41e29d6498e090edd3/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f686572747a62656c"&gt;&lt;img src="https://camo.githubusercontent.com/0de042a9e4100bed48f474f3358dba70130d7ec7ddb3fa41e29d6498e090edd3/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f686572747a62656c" alt="NPM"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;npm add hertzbel&lt;/code&gt; or &lt;code&gt;yarn add hertzbel&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Introduction&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;hertzbel&lt;/code&gt; is a javascript library created to handle frequency related calculations and conversions, and a comprehensive of decibel calculations.&lt;/p&gt;
&lt;p&gt;In telecommunications, frequencies and decibels go hand in hand. In the frequency domain, using decibel logarithmic formulas in place of Volts or Watts allows observers to see very high power levels and minuscule power levels on the same graph. To learn more about the usefulness of decibels visit &lt;a href="https://en.wikipedia.org/wiki/Decibel#:~:text=The%20decibel%20(symbol%3A%20dB),level%20or%20field%20level%2C%20respectively." rel="nofollow noopener noreferrer"&gt;wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Hertzbel library was designed specifically to be used with spectrum analyzer data, though these calculations will assist in any relatable fields.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Changelog&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;1.1.0&lt;/code&gt;: added toFixed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1.0.5&lt;/code&gt;: removed restriction to number of decimals&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1.0.3&lt;/code&gt;: added convertFrequency to Hertz&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1.0.0&lt;/code&gt;: initial launch of Hertzbel.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Hertz Functions&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Hertzbel has several frequency related calculations. Users may enter a string or a number as parameters into the functions.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h4 class="heading-element"&gt;Note: strings must be&lt;/h4&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Negatronic/hertzbel" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Hertz
&lt;/h2&gt;

&lt;p&gt;Hertzbel can take a frequency string and convert it to another frequency, add two frequencies together, subtract frequencies, multiply frequencies with integers, and divide with integers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Frequency Conversion
&lt;/h3&gt;

&lt;p&gt;Translate any frequency from Hz, kHz, MHz, GHz, THz to another.&lt;/p&gt;

&lt;h4&gt;
  
  
  note that values entered must be strings or numbers. Numbers will be considered to be in Hz base units.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  Example 1 &lt;code&gt;toMegaHz({string | number})&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toMegaHz&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;toMegaHz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1 GHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1000.000000 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A couple of things to take note of here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;toMegaHz can accept any combination of "1 GHz" (e.g., "1ghz", "1GHz", "1  GHZ  ")&lt;/li&gt;
&lt;li&gt;Depending on the to function, values will always show to Hz.&lt;/li&gt;
&lt;li&gt;the ToHz functions series can be strung together to work with other hertzbel calculations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example 2 &lt;code&gt;toTeraHz({string | number})&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toTeraHz&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;toTeraHz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;101 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.000101000000 THz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, I went to an extreme only to convey how cleanly hertzbel handles frequency conversions.&lt;/p&gt;

&lt;p&gt;The complete list of toHz functions is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ToHz()&lt;/li&gt;
&lt;li&gt;ToKiloHz()&lt;/li&gt;
&lt;li&gt;ToMegaHz()&lt;/li&gt;
&lt;li&gt;ToGigaHz()&lt;/li&gt;
&lt;li&gt;ToTeraHz()&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Frequency Addition
&lt;/h3&gt;

&lt;p&gt;Add any two frequencies together. The leading parameter will determine the resulting units.&lt;/p&gt;

&lt;h4&gt;
  
  
  note that values entered must be strings or numbers. Numbers will be considered to be in Hz base units.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  Example 1 &lt;code&gt;addFreq({string | number}, {string | number})&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;addFreq&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;addFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10khZ&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1001&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;11.001 kHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;As mentioned before, hertzbel will handle any frequency string as long as it has the right spelling.&lt;/li&gt;
&lt;li&gt;Using a number will force hertzbel to assume it is in Hz&lt;/li&gt;
&lt;li&gt;Note the returned value gives values down to the Hz&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example 2 &lt;code&gt;addFreq({string | number}, {string | number})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;addFreq&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;addFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1 GHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1010.000000 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Frequency Subtraction
&lt;/h3&gt;

&lt;p&gt;Subtracts one frequency from another. The leading parameter will determine the resulting units.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example &lt;code&gt;subFreq({string | number}, {string | number})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;subFreq&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;subFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10760 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1500 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;9260.000000 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Frequency Multiplication
&lt;/h3&gt;

&lt;p&gt;Multiples a frequency against an integer&lt;/p&gt;

&lt;h3&gt;
  
  
  Example &lt;code&gt;multFreq({string | number}, {number})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;multFreq&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;multFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;500 Hz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;25000 Hz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Frequency Division
&lt;/h3&gt;

&lt;p&gt;Divides a frequency against an integer&lt;/p&gt;

&lt;h3&gt;
  
  
  Example &lt;code&gt;divFreq({string | number}, {number})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;divFreq&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;divFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;3000 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;7.481297 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stringing Frequency Functions
&lt;/h3&gt;

&lt;p&gt;Hertzbel allows users to string frequency functions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 1
&lt;/h3&gt;

&lt;p&gt;User wants to divide 3000 MHz by 601 then convert that value to kHz&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toKiloHz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;divFreq&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;toKiloHz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;divFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;3000 MHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;601&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;4991.681 kHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2
&lt;/h3&gt;

&lt;p&gt;User wants to add three frequencies together: 100 kHz, 250 kHz, and 450 kHz.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;addFreq&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;addFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;addFreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100 kHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;250 kHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;450 kHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;800.000 kHz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Decibel
&lt;/h2&gt;

&lt;p&gt;The second piece of the hertzbel library is decibel conversion. RF, satcom, and other types of engineers have to convert power from Watts to decibels and back periodically.&lt;/p&gt;

&lt;p&gt;Hertzbel offers a simple way to perform dB conversions (though it is limited to Watts currently).&lt;/p&gt;

&lt;h3&gt;
  
  
  From Watts to Decibels
&lt;/h3&gt;

&lt;p&gt;Translates values from any Watt to any decibel. Users may enter a string or number as parameters into the function. Numbers will be considered to be in mW.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 1 &lt;code&gt;toDbm({string | number})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toDbm&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;toDbm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;20 mw&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;13 dBm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2 &lt;code&gt;toDbuw({string | number})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toDbuw&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;toDbuw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1W&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;60 dBuW&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The complete list of toDb is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;toDbuw()&lt;/li&gt;
&lt;li&gt;toDbm()&lt;/li&gt;
&lt;li&gt;toDbW()&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  From Decibels to Watts
&lt;/h3&gt;

&lt;p&gt;Converts values of any decibel to any Watt. Users must use a string.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 1 &lt;code&gt;toW({string})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toW&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;toW&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;40 dbuw&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.01 W&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2 &lt;code&gt;toMw({string})&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toMw&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hertzbel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;toMw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;-3 dbm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.5011 mW&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The complete list of toW is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;toUw()&lt;/li&gt;
&lt;li&gt;toMw()&lt;/li&gt;
&lt;li&gt;toW()&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Download
&lt;/h2&gt;

&lt;p&gt;Try out hertzbel instantly in your JavaScript app, just download with &lt;code&gt;npm add hertzbel&lt;/code&gt; or &lt;code&gt;yarn add hertzbel&lt;/code&gt; and start making something. View the npm library here &lt;a href="https://www.npmjs.com/package/hertzbel" rel="noopener noreferrer"&gt;hertzbel&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As a member of the Satcom community, I sincerely hope more libraries like hertzbel will appear in the open source ecosystem for newer languages.&lt;/p&gt;

&lt;p&gt;The JavaScript language is very conducive to writing fast code; it is widely supported, and extremely easy to configure. I, for one, feel like its time to start pushing Satcom software in a new direction, and hopefully, hertzbel will help start the transition.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>npm</category>
      <category>frequency</category>
      <category>decibel</category>
    </item>
    <item>
      <title>Using TLE.JS Library for Satellite Position and Dish Pointing</title>
      <dc:creator>Alex Mages</dc:creator>
      <pubDate>Mon, 10 Aug 2020 14:52:41 +0000</pubDate>
      <link>https://dev.to/awmages/using-tle-js-library-for-satellite-position-and-dish-pointing-1h14</link>
      <guid>https://dev.to/awmages/using-tle-js-library-for-satellite-position-and-dish-pointing-1h14</guid>
      <description>&lt;p&gt;Earlier last year I, blew the dust off my satellite communication textbook and attempted to write a dish pointing app for my company that's in the satellite communications realm.&lt;/p&gt;

&lt;p&gt;I quickly discovered that the math was involved, and after several days of exhausting math and Python code writing, I came up a (barely) usable app:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Negatronic" rel="noopener noreferrer"&gt;
        Negatronic
      &lt;/a&gt; / &lt;a href="https://github.com/Negatronic/dish-pointer" rel="noopener noreferrer"&gt;
        dish-pointer
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Parabolic Dish Pointing software
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;dish-pointer&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;the dish-pointer project a rough protoype of the equations required for Parabolic Dish Pointing software for GEO satellites.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;the dish-pointer should work on all OS that support Python 3.6&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Requirements&lt;/h3&gt;
&lt;/div&gt;
&lt;p&gt;main.py was written in Python 3.6, and has the following dependecies:&lt;/p&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Install&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;matplotlib&lt;/td&gt;
&lt;td&gt;Graphing and math Library&lt;/td&gt;
&lt;td&gt;3.03&lt;/td&gt;
&lt;td&gt;pip install matplotlib&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Installing&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Included in the project is a pip freeze of the needed libraries.
To install requirements using pip freeze&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;1. Open Command Line
2. cd to where dish-pointer project is cloned
3. Enter "pip install -r dish-pointer_pip_freeze.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Exectuion&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;To run main.py&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;1. Open Command Line
2. cd to where dish-pointer project is cloned
3. python main.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Example Operation&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;Enter Earth Station Longitude, for West use '-': -97.33
Enter Earth Station Latitude, for South use '-': 37.68
Enter Satellite subpoint Longitude, for West use '-': -123
Antenna azimuth is 218.2°
Antenna look angle 38.7°&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Negatronic/dish-pointer" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Recently, I came back to this project wanting to port it over to a React app and &lt;strong&gt;dreaded&lt;/strong&gt; refactoring the math, that is, until I discovered Two-Line Elements(TLE) set and the &lt;a href="https://github.com/davidcalhoun/tle.js/" rel="noopener noreferrer"&gt;tle.js&lt;/a&gt; library.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is TLE
&lt;/h2&gt;

&lt;p&gt;According to &lt;a href="https://en.wikipedia.org/wiki/Two-line_element_set" rel="noopener noreferrer"&gt;wikipedia.org&lt;/a&gt; the two-line element is&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;... a data format encoding a list of orbital elements of an Earth-orbiting object for a given point in time, the epoch. Using suitable prediction formula, the state (position and velocity) at any point in the past or future can be estimated to some accuracy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;below is an example TLE of the International Space Station&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ISS (ZARYA)             &lt;br&gt;
1 25544U 98067A   20220.25765183  .00031791  00000-0  57938-3 0  9999&lt;br&gt;
2 25544  51.6453  95.7043 0001117  20.0719 119.8247 15.49172948239931&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;TLEs give a series of mathematical numbers to plot the orbit of the space object, which can be utilized to find the predicted Latitude and Longitude (among other things).&lt;/p&gt;

&lt;p&gt;TLE's can be obtained from multiple sites such as &lt;a href="https://celestrak.com/NORAD/elements" rel="noopener noreferrer"&gt;celestrak.com&lt;/a&gt; &lt;a href="http://www.space-track.org/" rel="noopener noreferrer"&gt;space-track.org&lt;/a&gt;, and other websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is TLE.js
&lt;/h2&gt;

&lt;p&gt;During research for my web application, I discovered the &lt;a href="https://github.com/davidcalhoun/tle.js/" rel="noopener noreferrer"&gt;TLE.js&lt;/a&gt; library. TLE.js is a JavaScript library that processes the tle data with easy to use functions.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/davidcalhoun" rel="noopener noreferrer"&gt;
        davidcalhoun
      &lt;/a&gt; / &lt;a href="https://github.com/davidcalhoun/tle.js" rel="noopener noreferrer"&gt;
        tle.js
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      🛰️ Satellite TLE tools in JavaScript: get lat/lon of satellites, get look angles, plot orbit lines, extract individual TLE elements, etc
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;tle.js&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://www.npmjs.com/package/tle.js" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5be68c57fc899aa850012689cd31dc0a8e93daed3febbae53fe6993ed9d2aee8/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f746c652e6a732e737667" alt="npm downloads"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Satellite TLE tools in JavaScript&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;npm add tle.js&lt;/code&gt; or &lt;code&gt;yarn add tle.js&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Introduction&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;tle.js&lt;/code&gt; is designed to simplify satellite TLEs and SGP4 with a friendly interface, with &lt;a href="https://github.com/shashwatak/satellite-js" rel="noopener noreferrer"&gt;satellite.js&lt;/a&gt; doing the heavy lifting behind the scenes.&lt;/p&gt;
&lt;p&gt;The origin of TLEs goes back to the punchcard days! A &lt;a href="https://en.wikipedia.org/wiki/Two-line_element_set" rel="nofollow noopener noreferrer"&gt;TLE, or two-line element set&lt;/a&gt;, is used by &lt;a href="https://en.wikipedia.org/wiki/Simplified_perturbations_models" rel="nofollow noopener noreferrer"&gt;SGP4 propagators&lt;/a&gt;
to determine spacecraft positioning information, taking into account gravity perturbations (the
moon, etc).&lt;/p&gt;
&lt;p&gt;Most users will probably want to simply get the latitude/longitude of a satellite (see
&lt;a href="https://github.com/davidcalhoun/tle.js#getlatlngobjtle-optionaltimestampms" rel="noopener noreferrer"&gt;getLatLngObj&lt;/a&gt;) or get the look angles from a ground position, which can be used to track
where in the sky a satellite is visible (see &lt;a href="https://github.com/davidcalhoun/tle.js#getsatelliteinfotle-optionaltimestamp-observerlat-observerlng-observerelevation" rel="noopener noreferrer"&gt;getSatelliteInfo&lt;/a&gt;). Users may
also want to plot orbit lines (see &lt;a href="https://github.com/davidcalhoun/tle.js#getgroundtracksoptions" rel="noopener noreferrer"&gt;getGroundTracks&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Users may also be interested in grabbing specific values from a TLE. In this case, you
can use one of the &lt;a href="https://github.com/davidcalhoun/tle.js#basic-tle-getters" rel="noopener noreferrer"&gt;TLE getters&lt;/a&gt;, for…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/davidcalhoun/tle.js" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  TLE.js Example 1: Satellite Position
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;npm install tle.js&lt;/code&gt; or &lt;code&gt;yarn add tle.js&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Import
&lt;/h3&gt;

&lt;p&gt;in our index.js file import getLatLngObj&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getLatLngObj&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tle.js/dist/tlejs.cjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;create a constant of a string&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getLatLngObj&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tle.js/dist/tlejs.cjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`ISS (ZARYA)
1 25544U 98067A   17206.18396726  .00001961  00000-0  36771-4 0  9993
2 25544  51.6400 208.9163 0006317  69.9862  25.2906 15.54225995 67660`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;then console log the results&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getLatLngObj&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tle.js/dist/tlejs.cjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`ISS (ZARYA)
1 25544U 98067A   17206.18396726  .00001961  00000-0  36771-4 0  9993
2 25544  51.6400 208.9163 0006317  69.9862  25.2906 15.54225995 67660`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getLatLngObj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tle&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Console Log:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ lat: 32.69293160995973, lng: -164.48496742284183 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Note in our example Lng is a negative value; this means the satellite is currently in the Western Hemisphere, a positive value means would mean it is in the Eastern Hemisphere. If the Lat value is negative, then the satellite is in the Southern Hemisphere, if positive then the Northern Hemisphere.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getLatLngObj&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tle.js/dist/tlejs.cjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`ISS (ZARYA)
1 25544U 98067A   17206.18396726  .00001961  00000-0  36771-4 0  9993
2 25544  51.6400 208.9163 0006317  69.9862  25.2906 15.54225995 67660`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;satPos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getLatLngObj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tle&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;N&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lng&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;E&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;satPos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;lat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;S&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;satPos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lng&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;lng&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;W&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Latitude: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;satPos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;lat&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;, &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Longitude: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;satPos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lng&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;lng&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Console Log&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Latitude: 50.59794614813468 N, Longitude:  91.89917475916603 W
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  TLE.js Example 2: Dish Pointing
&lt;/h2&gt;

&lt;p&gt;To get azimuth and elevation directions from tle.js, use &lt;code&gt;getSatelliteInfo()&lt;/code&gt;. &lt;code&gt;getSatelliteInfo()&lt;/code&gt; variables are &lt;code&gt;getSatelliteInfo(tle, optionalTimestamp, observerLat, observerLng, oberserverElevation)&lt;/code&gt; note that the timestamp is optional.&lt;/p&gt;

&lt;p&gt;Grab the desired lat/long coordinates of the observer site, and paste into the correct constants.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getSatelliteInfo&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tle.js/dist/tlejs.cjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`ISS (ZARYA)
1 25544U 98067A   17206.18396726  .00001961  00000-0  36771-4 0  9993
2 25544  51.6400 208.9163 0006317  69.9862  25.2906 15.54225995 67660`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;observerLat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;37.709203&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;observerLng&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;97.427754&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;run &lt;code&gt;getSatelliteInfo()&lt;/code&gt;. If not using optionalTimestamp enter null, if on the ground enter 0 for elevation.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getSatelliteInfo&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tle.js/dist/tlejs.cjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`ISS (ZARYA)
1 25544U 98067A   17206.18396726  .00001961  00000-0  36771-4 0  9993
2 25544  51.6400 208.9163 0006317  69.9862  25.2906 15.54225995 67660`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;observerLat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;37.709203&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;observerLng&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;97.427754&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getSatelliteInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;observerLat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;observerLng&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Console Log&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  lng: -103.77041233731748,
  lat: 48.083145374941935,
  elevation: 11.084527491294315,
  azimuth: 337.91719541768254,
  range: 1357.0378375655516,
  height: 393.729417250428,
  velocity: 7.679154118414166
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;lng is the longitudinal position of the satellite&lt;/li&gt;
&lt;li&gt;lat is the latitudinal position of the satellite&lt;/li&gt;
&lt;li&gt;elevation is the dish's pointing elevation&lt;/li&gt;
&lt;li&gt;azimuth is the dish's needed direction to point the satellite&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;getSattelliteInfo()&lt;/code&gt; doesn't take in consideration the line of sight of the dish, and whether the satellite is observable for that use &lt;code&gt;getVisibleSattelites()&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By utilizing the tle.js library, modern engineers can quickly deploy web or mobile applications that can track satellites, provide satellite dish look angles, and provide a list of visible satellites. With just a bit of searching &lt;br&gt;
you can find great libraries, like tle.js, that significantly reduce the headache and time spent on small components of much larger projects.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example Code
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Negatronic" rel="noopener noreferrer"&gt;
        Negatronic
      &lt;/a&gt; / &lt;a href="https://github.com/Negatronic/tle-example" rel="noopener noreferrer"&gt;
        tle-example
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>satellite</category>
      <category>javascript</category>
      <category>node</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
