{
    "version": "https://jsonfeed.org/version/1",
    "title": "BT Blog",
    "home_page_url": "https://btwiki.github.io//blog/",
    "feed_url": "https://btwiki.github.io//blog/feed.json",
    "description": "We're sorry in advance",
    "icon": "https://btwiki.github.io//blog/apple-touch-icon.png",
    "favicon": "https://btwiki.github.io//blog/favicon.ico",
    "expired": false,
    
    "author": "{"twitter"=>nil, "name"=>nil, "avatar"=>nil, "email"=>nil, "url"=>nil}",
    
"items": [
    
        {
            "id": "https://btwiki.github.io//blog/2022/01/28/reaction-flywheels",
            "title": "Reaction Flywheels",
            "summary": "And a whole lotta math",
            "content_text": "Reaction Wheels\\(I_s\\) is the moment of inertia (MOI) of the spacecraft\\(\\omega_s\\) is the desired angular velocity of the spacecraft\\(\\omega_m\\) is the maximum angular velocity the motor can produce\\(I_f\\) is the necessary flywheel MOIWe start by calculating the inertial-frame flywheel angular velocity,which slightly differs from the motor’s as the stator is mounted to aspacecraft\\[\\omega_f = \\omega_m - \\omega_s\\]We then apply this to the conservation of angular momentum\\[\\omega_f I_f = \\omega_s I_s\\]\\[(\\omega_m - \\omega_s) I_f = \\omega_s I_s\\]\\[I_f = \\frac{\\omega_s I_s}{\\omega_m - \\omega_s}\\]To obtain the necessary flywheel moment of inertia to achieve the desiredspacecraft angular velocity.Note that this is independent of the maximum output torque of the motor,only the maximum angular velocity, as a lower torque will only reduce theangular acceleration and not the final angular velocity.",
            "content_html": "<h1 id=\"reaction-wheels\">Reaction Wheels</h1><p>\\(I_s\\) is the moment of inertia (MOI) of the spacecraft</p><p>\\(\\omega_s\\) is the desired angular velocity of the spacecraft</p><p>\\(\\omega_m\\) is the maximum angular velocity the motor can produce</p><p>\\(I_f\\) is the necessary flywheel MOI</p><p>We start by calculating the inertial-frame flywheel angular velocity,which slightly differs from the motor’s as the stator is mounted to aspacecraft</p>\\[\\omega_f = \\omega_m - \\omega_s\\]<p>We then apply this to the conservation of angular momentum</p>\\[\\omega_f I_f = \\omega_s I_s\\]\\[(\\omega_m - \\omega_s) I_f = \\omega_s I_s\\]\\[I_f = \\frac{\\omega_s I_s}{\\omega_m - \\omega_s}\\]<p>To obtain the necessary flywheel moment of inertia to achieve the desiredspacecraft angular velocity.</p><p>Note that this is independent of the maximum output torque of the motor,only the maximum angular velocity, as a lower torque will only reduce theangular acceleration and not the final angular velocity.</p>",
            "url": "https://btwiki.github.io//blog/2022/01/28/reaction-flywheels",
            
            
            
            "tags": ["math","space"],
            
            "date_published": "2022-01-28T03:12:24+00:00",
            "date_modified": "2022-01-28T03:12:24+00:00",
            
                "author": "perry"
            
        },
    
        {
            "id": "https://btwiki.github.io//blog/2022/01/22/gps-the-faq",
            "title": "GPS, What The FAQ?",
            "summary": "The not complete \"how to\" about GPS",
            "content_text": "1. How can I get my GPS happy even when he’s not?Three easy solutions to get your GPS happy :  Power the GPS standalone before the rest of the stuff and wait for it to get a fix. Disconnect the standalone cable and reconnect the GPS to the rest.  Try powering runcams, video transmitters and telemetry radios ONLY ONCE GPS fix is acquired.  If none of above worked, the “guide of the good engineer 2022 (updated edition)” recommends  using a hammer as a deterrent tool. GPS will quickly understand who’s the boss, and in case he doesn’t, he will quickly cease to be a GPS.2. Sometimes my GPS is really happy and then a few hours after he’s not, what to do?  The integrated battery on your GPS keep the informations needed for a hot start (happy GPS) for about 3 hours, afterwards your GPS will have to wait to be happy on startup again3. Can my GPS be happy even higher than so called “COCOM” limits?  YES, your GPS can perfectly be happy up to 50km or even 80km above sea level, you just have to put it in the “airborne &lt;4G mode” if it’s a Ublox GPS. The SAM-M8Q can for example go up to 50km, and the NEO-M9N up to 80km. Oh and by the way “CoCom ceased to function on March 31, 1994, and the then-current control list of embargoed goods was retained by the member nations until the successor, the Wassenaar Arrangement, was established.” :)4. Is it legal to put my GPS into the illegal dangerous bad (gone wrong!!) “airborne &lt;4G mode”  NO. NO NOOOOOOOOOOOOO, it’s not illegal to put your GPS into the illegal dangerous bad (gone wrong!!) “airborne &lt;4G mode”. It’s designed for. You have to send the right setup command to the GPS via serial. The command is not the same for different GPS models. Try looking for the GPS’s datasheet, and then the communication protocol for your specific GPS model.5. I want my GPS to only send data when I want, how can I do this?  Most GPS sends data at a fixed rate that you can set using the settings. All the libraries proposing so called “polling” functions are just going to freeze your code until the next time the GPS decides to send a message because he’s happy.7. Why does the military want to limit my GPS at 4G??!!!  They don’t give a shit about your GPS accelerating at more than 4G but physics does. This is not a limitation but a physical limit. After this limit the GPS position precision will drop.8. I can’t get my GPS to speak the same language as my TEVECEEE flight computer, what can I do?  Check the baud rate used for the communication between your computer and the GPS (AKA the UART serial port). Use 9600 as a first value. Most GPS use this baud speed as a factory setting.  TX and RX are not gay, TX goes with RX and RX goes with TX.9. I want to change the settings of my GPS how to do?  Download and install U-Center if it’s a Ublox GPS, otherwise you’re pretty much not happy to not say f.. yeah you got it no need to write it.  Get yourself a UART to USB converter (search for a FTDI dongle) to connect the GPS to your PC. Alternative solution: butcher an Arduino Nano to use it as and FTDI dongle.10. My GPS can connect to U-Center but I can’t change the settings  Open the serial monitor right when you connect the GPS, and look at the first sentence sent by the GPS.  Open google and search for “Fake Ublox GPS, how to recognise them?” and learn why it was a bad idea to buy a GPS on Amazon for 7$ (you can replace “GPS” by any other hardware you want, it’s pretty much the same).11. Damn.. so my GPS is a fake, what can I do now?  The SAM-M8Q GPS is a really good, small GPS. You can find a lot of differents breakouts easy to use. I’m sure you know what you have to do.did you notice point 6 was missing?:)",
            "content_html": "<h2 id=\"1-how-can-i-get-my-gps-happy-even-when-hes-not\">1. How can I get my GPS happy even when he’s not?</h2><p>Three easy solutions to get your GPS happy :</p><ul>  <li>Power the GPS standalone before the rest of the stuff and wait for it to get a fix. Disconnect the standalone cable and reconnect the GPS to the rest.</li>  <li>Try powering runcams, video transmitters and telemetry radios <strong>ONLY ONCE</strong> GPS fix is acquired.</li>  <li>If none of above worked, the <em>“guide of the good engineer 2022 (updated edition)”</em> recommends  using a hammer as a deterrent tool. GPS will quickly understand who’s the boss, and in case he doesn’t, he will quickly cease to be a GPS.</li></ul><p><br /></p><h2 id=\"2-sometimes-my-gps-is-really-happy-and-then-a-few-hours-after-hes-not-what-to-do\">2. Sometimes my GPS is really happy and then a few hours after he’s not, what to do?</h2><ul>  <li>The integrated battery on your GPS keep the informations needed for a hot start (happy GPS) for about 3 hours, afterwards your GPS will have to wait to be happy on startup again</li></ul><p><br /></p><h2 id=\"3-can-my-gps-be-happy-even-higher-than-so-called-cocom-limits\">3. Can my GPS be happy even higher than so called “COCOM” limits?</h2><ul>  <li><strong>YES</strong>, your GPS can perfectly be happy up to 50km or even 80km above sea level, you just have to put it in the “airborne &lt;4G mode” if it’s a Ublox GPS. The SAM-M8Q can for example go up to 50km, and the NEO-M9N up to 80km. Oh and by the way <em>“CoCom ceased to function on March 31, 1994, and the then-current control list of embargoed goods was retained by the member nations until the successor, the <a href=\"https://en.wikipedia.org/wiki/Wassenaar_Arrangement\">Wassenaar Arrangement</a>, was established.”</em> :)</li></ul><p><br /></p><h2 id=\"4-is-it-legal-to-put-my-gps-into-the-illegal-dangerous-bad-gone-wrong-airborne-4g-mode\">4. Is it legal to put my GPS into the illegal dangerous bad (gone wrong!!) “airborne &lt;4G mode”</h2><ul>  <li>NO. N<strong>O</strong> NO<strong>OOOOO</strong>OO<strong>OOOOO</strong>, it’s not illegal to put your GPS into the illegal dangerous bad (gone wrong!!) “airborne &lt;4G mode”. <strong>It’s designed for</strong>. You have to send the right setup command to the GPS via serial. The command is not the same for different GPS models. Try looking for the GPS’s datasheet, and then the communication protocol for your specific GPS model.</li></ul><p><br /></p><h2 id=\"5-i-want-my-gps-to-only-send-data-when-i-want-how-can-i-do-this\">5. I want my GPS to only send data when I want, how can I do this?</h2><ul>  <li>Most GPS sends data at a fixed rate that you can set using the settings. All the libraries proposing so called “polling” functions are just going to freeze your code until the next time the GPS decides to send a message because he’s happy.</li></ul><p><br /></p><h2 id=\"7-why-does-the-military-want-to-limit-my-gps-at-4g\">7. Why does the military want to limit my GPS at 4G??!!!</h2><ul>  <li>They don’t give a shit about your GPS accelerating at more than 4G but physics does. This is not a limitation but a physical limit. After this limit the GPS position precision will drop.</li></ul><p><br /></p><h2 id=\"8-i-cant-get-my-gps-to-speak-the-same-language-as-my-teveceee-flight-computer-what-can-i-do\">8. I can’t get my GPS to speak the same language as my TEVECEEE flight computer, what can I do?</h2><ul>  <li>Check the baud rate used for the communication between your computer and the GPS (AKA the UART serial port). Use 9600 as a first value. Most GPS use this baud speed as a factory setting.</li>  <li>TX and RX are not gay, TX goes with RX and RX goes with TX.</li></ul><p><br /></p><h2 id=\"9-i-want-to-change-the-settings-of-my-gps-how-to-do\">9. I want to change the settings of my GPS how to do?</h2><ul>  <li>Download and install U-Center if it’s a Ublox GPS, otherwise you’re pretty much not happy to not say f.. yeah you got it no need to write it.</li>  <li>Get yourself a UART to USB converter (search for a FTDI dongle) to connect the GPS to your PC. Alternative solution: butcher an Arduino Nano to use it as and FTDI dongle.</li></ul><p><br /></p><h2 id=\"10-my-gps-can-connect-to-u-center-but-i-cant-change-the-settings\">10. My GPS can connect to U-Center but I can’t change the settings</h2><ul>  <li>Open the serial monitor right when you connect the GPS, and look at the first sentence sent by the GPS.</li>  <li>Open google and search for “Fake Ublox GPS, how to recognise them?” and learn why it was a bad idea to buy a GPS on Amazon for 7$ <em>(you can replace “GPS” by any other hardware you want, it’s pretty much the same)</em>.</li></ul><p><br /></p><h2 id=\"11-damn-so-my-gps-is-a-fake-what-can-i-do-now\">11. Damn.. so my GPS is a fake, what can I do now?</h2><ul>  <li>The SAM-M8Q GPS is a really good, small GPS. You can find a lot of differents breakouts easy to use. I’m sure you know what you have to do.</li></ul><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p>did you notice point 6 was missing?</p><p>:)</p>",
            "url": "https://btwiki.github.io//blog/2022/01/22/gps-the-faq",
            
            
            
            
            
            "date_published": "2022-01-22T04:40:00+00:00",
            "date_modified": "2022-01-22T04:40:00+00:00",
            
                "author": "Yohan"
            
        },
    
        {
            "id": "https://btwiki.github.io//blog/2021/12/16/py-vector",
            "title": "Python vector framework",
            "summary": "Because math is for snakes",
            "content_text": "A Python Vector LibraryIn preparation for simulationIn order to design a 6DOF simulation for vehicle testing, wewill need a Vector3 object to store 3-dimensional values.Why 3? Think x, y, z; pitch, yaw, and roll. A 6DOF simulationhas three axes, so vector values have the same. We begin withthe class header:class Vector3:    def __init__(self, x, y, z):        self.x = x        self.y = y        self.z = zBut this setup is not very convenient, and also lacks any formof type hints or guarantees. Let’s spice it up a bit!@dataclassclass Vector3:    x : float = 0    y : float = 0    z : float = 0    def __init__(self, x : float = 0, y : float = 0, z : float = 0) -&gt; None:        self.x = float(x)        self.y = float(y)        self.z = float(z)This class definition and constructor will take advantage of Python’stype hinting, as well as the @dataclass decorator, which allows linterslike pylance to report member variables of a class at dev time. The typehints also allow type linters like mypy to scan the file and uncoverany potential mismatches, but in the absence of mypy, Python will stillaccept non-float’s for x, y, and z, so they must be explicitly cast.For ease of use later on, we will also add a factory function togenerate a zero-value Vector3:@classmethoddef Zero(cls) -&gt; Vector3:    return cls(0, 0, 0)However, at this point, we run into a fun problem with python’s typehinting. Types currently cannot be used for hinting until they are complete,which means you can’t say, specify that a method in Vector3 will return a Vector3 object. This will be changed in coming updates to Python, but itcan be worked around by simply adding the linefrom __future__ import annotationsto the imports of your project.The @dataclass decorator will automatically generate __str__ and__repr__ functions for us, but the format is somewhat less than desirable,so we’ll override them with our own:def __str__(self) -&gt; str:    return ''.join([\"(\", str(self.x), \",\",        str(self.y), \",\", str(self.z), \")\"])def __repr__(self) -&gt; str:    return ''.join([\"Vector3(\", str(self.x), \",\",        str(self.y), \",\", str(self.z), \")\"])And for comparisons, to allow for checking state variables and other genericchecks on Vector3 objects, we implement __eq__ and __ne__:def __eq__(self, other : object) -&gt; bool:    if not isinstance(other, Vector3):        return NotImplemented    return ((self.x == other.x) and (self.y == other.y) and (self.z == other.z))def __ne__(self, other : object) -&gt; bool:    if not isinstance(other, Vector3):        return NotImplemented    return ((self.x != other.x) or (self.y != other.y) or (self.z != other.z))Python requires equality &amp; inequality functions to accept any objects, so thefirst line of comparison/inequality functions must be a type check to avoidaccessing nonexistent member variables. Returning NotImplemented flags theinterpreter to check the other object’s type for a compatible comparisonfunction, and is a uniquely Pythonic concept.More code for the vector math functions to come in pt.2 of this post!",
            "content_html": "<h1 id=\"a-python-vector-library\">A Python Vector Library</h1><h3 id=\"in-preparation-for-simulation\">In preparation for simulation</h3><p>In order to design a 6DOF simulation for vehicle testing, wewill need a Vector3 object to store 3-dimensional values.Why 3? Think x, y, z; pitch, yaw, and roll. A 6DOF simulationhas three axes, so vector values have the same. We begin withthe class header:</p><div class=\"language-py highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">class</span> <span class=\"nc\">Vector3</span><span class=\"p\">:</span>    <span class=\"k\">def</span> <span class=\"nf\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">,</span> <span class=\"n\">z</span><span class=\"p\">):</span>        <span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">x</span>        <span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"n\">y</span>        <span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">=</span> <span class=\"n\">z</span></code></pre></div></div><p>But this setup is not very convenient, and also lacks any formof type hints or guarantees. Let’s spice it up a bit!</p><div class=\"language-py highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"o\">@</span><span class=\"n\">dataclass</span><span class=\"k\">class</span> <span class=\"nc\">Vector3</span><span class=\"p\">:</span>    <span class=\"n\">x</span> <span class=\"p\">:</span> <span class=\"nb\">float</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>    <span class=\"n\">y</span> <span class=\"p\">:</span> <span class=\"nb\">float</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>    <span class=\"n\">z</span> <span class=\"p\">:</span> <span class=\"nb\">float</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>    <span class=\"k\">def</span> <span class=\"nf\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x</span> <span class=\"p\">:</span> <span class=\"nb\">float</span> <span class=\"o\">=</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">y</span> <span class=\"p\">:</span> <span class=\"nb\">float</span> <span class=\"o\">=</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">z</span> <span class=\"p\">:</span> <span class=\"nb\">float</span> <span class=\"o\">=</span> <span class=\"mi\">0</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"bp\">None</span><span class=\"p\">:</span>        <span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span>        <span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">y</span><span class=\"p\">)</span>        <span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">z</span><span class=\"p\">)</span></code></pre></div></div><p>This class definition and constructor will take advantage of Python’stype hinting, as well as the <code class=\"language-plaintext highlighter-rouge\">@dataclass</code> decorator, which allows linterslike pylance to report member variables of a class at dev time. The typehints also allow type linters like mypy to scan the file and uncoverany potential mismatches, but in the absence of mypy, Python will stillaccept non-float’s for x, y, and z, so they must be explicitly cast.</p><p>For ease of use later on, we will also add a factory function togenerate a zero-value Vector3:</p><div class=\"language-py highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"o\">@</span><span class=\"nb\">classmethod</span><span class=\"k\">def</span> <span class=\"nf\">Zero</span><span class=\"p\">(</span><span class=\"n\">cls</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"n\">Vector3</span><span class=\"p\">:</span>    <span class=\"k\">return</span> <span class=\"n\">cls</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span></code></pre></div></div><p>However, at this point, we run into a <em>fun</em> problem with python’s typehinting. Types currently cannot be used for hinting until they are complete,which means you can’t say, specify that a method in Vector3 will return a Vector3 object. This will be changed in coming updates to Python, but itcan be worked around by simply adding the line</p><div class=\"language-py highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kn\">from</span> <span class=\"nn\">__future__</span> <span class=\"kn\">import</span> <span class=\"n\">annotations</span></code></pre></div></div><p>to the imports of your project.</p><p>The <code class=\"language-plaintext highlighter-rouge\">@dataclass</code> decorator will automatically generate <code class=\"language-plaintext highlighter-rouge\">__str__</code> and<code class=\"language-plaintext highlighter-rouge\">__repr__</code> functions for us, but the format is somewhat less than desirable,so we’ll override them with our own:</p><div class=\"language-py highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">def</span> <span class=\"nf\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"nb\">str</span><span class=\"p\">:</span>    <span class=\"k\">return</span> <span class=\"s\">''</span><span class=\"p\">.</span><span class=\"n\">join</span><span class=\"p\">([</span><span class=\"s\">\"(\"</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">x</span><span class=\"p\">),</span> <span class=\"s\">\",\"</span><span class=\"p\">,</span>        <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">y</span><span class=\"p\">),</span> <span class=\"s\">\",\"</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">z</span><span class=\"p\">),</span> <span class=\"s\">\")\"</span><span class=\"p\">])</span><span class=\"k\">def</span> <span class=\"nf\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"nb\">str</span><span class=\"p\">:</span>    <span class=\"k\">return</span> <span class=\"s\">''</span><span class=\"p\">.</span><span class=\"n\">join</span><span class=\"p\">([</span><span class=\"s\">\"Vector3(\"</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">x</span><span class=\"p\">),</span> <span class=\"s\">\",\"</span><span class=\"p\">,</span>        <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">y</span><span class=\"p\">),</span> <span class=\"s\">\",\"</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">z</span><span class=\"p\">),</span> <span class=\"s\">\")\"</span><span class=\"p\">])</span></code></pre></div></div><p>And for comparisons, to allow for checking state variables and other genericchecks on Vector3 objects, we implement <code class=\"language-plaintext highlighter-rouge\">__eq__</code> and <code class=\"language-plaintext highlighter-rouge\">__ne__</code>:</p><div class=\"language-py highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">def</span> <span class=\"nf\">__eq__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span> <span class=\"p\">:</span> <span class=\"nb\">object</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"nb\">bool</span><span class=\"p\">:</span>    <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">Vector3</span><span class=\"p\">):</span>        <span class=\"k\">return</span> <span class=\"nb\">NotImplemented</span>    <span class=\"k\">return</span> <span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">x</span> <span class=\"o\">==</span> <span class=\"n\">other</span><span class=\"p\">.</span><span class=\"n\">x</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">y</span> <span class=\"o\">==</span> <span class=\"n\">other</span><span class=\"p\">.</span><span class=\"n\">y</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">==</span> <span class=\"n\">other</span><span class=\"p\">.</span><span class=\"n\">z</span><span class=\"p\">))</span><span class=\"k\">def</span> <span class=\"nf\">__ne__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span> <span class=\"p\">:</span> <span class=\"nb\">object</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"nb\">bool</span><span class=\"p\">:</span>    <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">Vector3</span><span class=\"p\">):</span>        <span class=\"k\">return</span> <span class=\"nb\">NotImplemented</span>    <span class=\"k\">return</span> <span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">x</span> <span class=\"o\">!=</span> <span class=\"n\">other</span><span class=\"p\">.</span><span class=\"n\">x</span><span class=\"p\">)</span> <span class=\"ow\">or</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">y</span> <span class=\"o\">!=</span> <span class=\"n\">other</span><span class=\"p\">.</span><span class=\"n\">y</span><span class=\"p\">)</span> <span class=\"ow\">or</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">!=</span> <span class=\"n\">other</span><span class=\"p\">.</span><span class=\"n\">z</span><span class=\"p\">))</span></code></pre></div></div><p>Python requires equality &amp; inequality functions to accept any objects, so thefirst line of comparison/inequality functions must be a type check to avoidaccessing nonexistent member variables. Returning <code class=\"language-plaintext highlighter-rouge\">NotImplemented</code> flags theinterpreter to check the other object’s type for a compatible comparisonfunction, and is a uniquely Pythonic concept.</p><p>More code for the vector math functions to come in pt.2 of this post!</p>",
            "url": "https://btwiki.github.io//blog/2021/12/16/py-vector",
            
            
            
            "tags": ["py","sim"],
            
            "date_published": "2021-12-16T00:12:18+00:00",
            "date_modified": "2021-12-16T00:12:18+00:00",
            
                "author": "perry"
            
        },
    
        {
            "id": "https://btwiki.github.io//blog/2021/12/15/cross-product-wtf",
            "title": "WTF is the cross product",
            "summary": "What do it do",
            "content_text": "Bro wtfWhat is this thing like\\[\\vec{A}\\times\\vec{B}\\]How does it\\[\\vec{A}\\times\\vec{B}=|\\vec{A}|\\cdot|\\vec{B}|\\cdot\\sin(\\theta)\\hat{n}\\]What in the\\[\\vec{\\tau}=\\vec{r}\\times\\vec{F}\\]HOW",
            "content_html": "<h1 id=\"bro-wtf\">Bro wtf</h1><p>What is this thing like</p>\\[\\vec{A}\\times\\vec{B}\\]<p>How does it</p>\\[\\vec{A}\\times\\vec{B}=|\\vec{A}|\\cdot|\\vec{B}|\\cdot\\sin(\\theta)\\hat{n}\\]<p>What in the</p>\\[\\vec{\\tau}=\\vec{r}\\times\\vec{F}\\]<p><strong>HOW</strong></p>",
            "url": "https://btwiki.github.io//blog/2021/12/15/cross-product-wtf",
            
            
            
            
            
            "date_published": "2021-12-15T17:27:04+00:00",
            "date_modified": "2021-12-15T17:27:04+00:00",
            
                "author": "perry"
            
        },
    
        {
            "id": "https://btwiki.github.io//blog/2021/12/15/the-corner-of-rej",
            "title": "rej's corner",
            "summary": "this is a bad place ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ",
            "content_text": "you know what time it isit’s time for another crusadewhat is rej listening totrash probably. i’m going through itperry has just warned meperry has just warned me that i took his repoginitycomedy sectioncall me a sidewinder cause she guide the missilesupportgo give your local aerospace engineer some zip ties",
            "content_html": "<h1 id=\"you-know-what-time-it-is\">you know what time it is</h1><p>it’s time for another crusade</p><h1 id=\"what-is-rej-listening-to\">what is rej listening to</h1><p>trash probably. i’m going through it<br /><br /><img src=\"https://spotify-github-profile.vercel.app/api/view?uid=1diifnaqph0norv6er4w8r5du&amp;cover_image=true&amp;theme=compact\" /></p><h1 id=\"perry-has-just-warned-me\">perry has just warned me</h1><p>perry has just warned me that i took his repoginity</p><h1 id=\"comedy-section\">comedy section</h1><p>call me a sidewinder cause she guide the missile</p><h1 id=\"support\">support</h1><p>go give your local aerospace engineer some zip ties</p>",
            "url": "https://btwiki.github.io//blog/2021/12/15/the-corner-of-rej",
            
            
            
            
            
            "date_published": "2021-12-15T17:00:00+00:00",
            "date_modified": "2021-12-15T17:00:00+00:00",
            
                "author": "rej"
            
        },
    
        {
            "id": "https://btwiki.github.io//blog/2021/12/15/finding-stock",
            "title": "Stock in the Chip Shortage",
            "summary": "Where'd it all go?",
            "content_text": "The Chip Shortage Is Real.There’s no doubt about it. From decades-long lead times to maximum-stock limits on popular chips, the effect of theglobal pandemic on supply chains is being felt worldwide.In the midst of such n serious silicon scarcity, what is thehumble hobbyist to do?Finding Stock in a Stockless WorldWe’ve all felt it by now, the seemingly endless hours of scrolling,searching, trying new filters, only to see the last few items of thatseemingly perfect component snatched by an unseen hand. Findingstock is hard enough without a global chip shortage, so here’s afew tips for getting those parts you still need:      Search every supplier you canDigiKey, Mouser, Arrow, Newark, anyone you can get search terms in.Alternatively, search octopart for many distributors at once.        Don’t restrict yourself to one packageMany components come in a range of package styles, such as a mixture of SOICand USON/WSON for flash chips, or QFPs &amp; QFNs for most microcontrollers.Apart from their footprints &amp; dimensions, these part variants often havethe same pin assignments as their package relatives, and can be directlyswapped in (albeit, with a change of footprint) in lieu of other stock.        If all else fails, find pin-compatible replacementsSome components just don’t have alternate packages, or maybe they’re out of stocktoo. In that case, you might be able to find similar components using asupplier’s parametric search tool. Some suppliers, like DigiKey most recently,even offer suggestions for replacements in clear view when searchedcomponents have no stock. A mixture of compatible replacements and differentpackages may have luck too.  Sometimes, failure is inevitable.No matter how far you search or how many alternatives you consider, there area number of specialized or otherwise hard-to-find components that are just simplyunavailable in the current state of the supply chain. Some designs can be reworkedto accomodate different solutions, but some will just have to wait, and hope, forthe shortage to end soon.",
            "content_html": "<h1 id=\"the-chip-shortage-is-real\">The Chip Shortage Is Real.</h1><p>There’s no doubt about it. From decades-long lead times to maximum-stock limits on popular chips, the effect of theglobal pandemic on supply chains is being felt worldwide.</p><p>In the midst of such n serious silicon scarcity, what is thehumble hobbyist to do?</p><p><img src=\"https://wompampsupport.azureedge.net/fetchimage?siteId=7575&amp;v=2&amp;jpgQuality=100&amp;width=700&amp;url=https%3A%2F%2Fi.kym-cdn.com%2Fentries%2Ficons%2Foriginal%2F000%2F023%2F987%2Fovercome.jpg\" alt=\"Improvise, Adapt, Overcome\" /></p><hr /><p><br /></p><h1 id=\"finding-stock-in-a-stockless-world\">Finding Stock in a Stockless World</h1><p>We’ve all felt it by now, the seemingly endless hours of scrolling,searching, trying new filters, only to see the last few items of thatseemingly perfect component snatched by an unseen hand. Findingstock is hard enough <em>without</em> a global chip shortage, so here’s afew tips for getting those parts you still need:</p><ol>  <li>    <p><strong>Search every supplier you can</strong><br />DigiKey, Mouser, Arrow, Newark, anyone you can get search terms in.<br />Alternatively, search <a href=\"https://octopart.com/\">octopart</a> for many distributors at once.</p>  </li>  <li>    <p><strong>Don’t restrict yourself to one package</strong><br />Many components come in a range of package styles, such as a mixture of SOICand USON/WSON for flash chips, or QFPs &amp; QFNs for most microcontrollers.Apart from their footprints &amp; dimensions, these part variants often havethe same pin assignments as their package relatives, and can be directlyswapped in (albeit, with a change of footprint) in lieu of other stock.</p>  </li>  <li>    <p><strong>If all else fails, find pin-compatible replacements</strong><br />Some components just don’t have alternate packages, or maybe they’re out of stocktoo. In that case, you might be able to find similar components using asupplier’s parametric search tool. Some suppliers, like DigiKey most recently,even offer suggestions for replacements in clear view when searchedcomponents have no stock. A mixture of compatible replacements and differentpackages may have luck too.</p>  </li></ol><p><br /></p><h2 id=\"sometimes-failure-is-inevitable\">Sometimes, failure is inevitable.</h2><p>No matter how far you search or how many alternatives you consider, there area number of specialized or otherwise hard-to-find components that are just simplyunavailable in the current state of the supply chain. Some designs can be reworkedto accomodate different solutions, but some will just have to wait, and hope, forthe shortage to end soon.</p>",
            "url": "https://btwiki.github.io//blog/2021/12/15/finding-stock",
            
            
            
            "tags": ["imu","arduino"],
            
            "date_published": "2021-12-15T04:41:18+00:00",
            "date_modified": "2021-12-15T04:41:18+00:00",
            
                "author": "perry"
            
        },
    
        {
            "id": "https://btwiki.github.io//blog/2021/12/15/welcome",
            "title": "Welcome to the Blog!",
            "summary": "We're sorry in advance",
            "content_text": "We’re sorry in advanceThis blog is going to be full of a lot of random content,and a lot of stuff that we just think of randomly whileworking on projects.This post will serve as a sort of format template so wedon’t forget either lolFormat rules  Newlines are ignored. Double newlines act as section spacers.  To create a line break, end a line with two or more spaces  #, ##, and ### are three levels of header  Mathjax can be enabled by usemathjax: true in the header  *Asterisks* make italics  **More of them** make bold textMathjax can be used mid-line like \\(E=mc^2\\) or put on its own line\\[E=mc^2\\]But both are formatted as $$math$$  Blockquotes can be made using &gt; to mark the text      Nested blockquotes can be made &gt;&gt; by simply adding more    Formatting works in blockquotes  Unordered lists work by  simply starting each line with  a -   Ordered lists work by  putting a number instead,  like 4. The rest of markdown should be hopefully self-explanatory.A sample post front matter can also be found below. Enjoy!---layout: postauthor: your-nametitle: The post title!description: Something descriptivesummary: Something shorttags: [any, tags]usemathjax: true---",
            "content_html": "<h1 id=\"were-sorry-in-advance\">We’re sorry in advance</h1><p>This blog is going to be full of a lot of random content,and a lot of stuff that we just think of randomly whileworking on projects.</p><p>This post will serve as a sort of format template so wedon’t forget either lol</p><hr /><p><br /></p><h1 id=\"format-rules\">Format rules</h1><ul>  <li>Newlines are ignored. Double newlines act as section spacers.</li>  <li>To create a line break, end a line with two or more spaces</li>  <li>#, ##, and ### are three levels of header</li>  <li>Mathjax can be enabled by <code class=\"language-plaintext highlighter-rouge\">usemathjax: true</code> in the header</li>  <li><code class=\"language-plaintext highlighter-rouge\">*Asterisks*</code> make <em>italics</em></li>  <li><code class=\"language-plaintext highlighter-rouge\">**More of them**</code> make <strong>bold text</strong></li></ul><p>Mathjax can be used mid-line like \\(E=mc^2\\) or put on its own line</p>\\[E=mc^2\\]<p>But both are formatted as <code class=\"language-plaintext highlighter-rouge\">$$math$$</code></p><blockquote>  <p>Blockquotes can be made using <code class=\"language-plaintext highlighter-rouge\">&gt; to mark the text</code></p>  <blockquote>    <p>Nested blockquotes can be made <code class=\"language-plaintext highlighter-rouge\">&gt;&gt; by simply adding more</code></p>  </blockquote>  <p><strong>Formatting</strong> works in blockquotes</p></blockquote><p><br /></p><ul>  <li>Unordered lists work by</li>  <li>simply starting each line with</li>  <li>a <code class=\"language-plaintext highlighter-rouge\">- </code></li></ul><p><br /></p><ol>  <li>Ordered lists work by</li>  <li>putting a number instead,</li>  <li>like <code class=\"language-plaintext highlighter-rouge\">4. </code></li></ol><p><br />The rest of markdown should be hopefully self-explanatory.<br />A sample post front matter can also be found below. Enjoy!</p><div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nn\">---</span><span class=\"na\">layout</span><span class=\"pi\">:</span> <span class=\"s\">post</span><span class=\"na\">author</span><span class=\"pi\">:</span> <span class=\"s\">your-name</span><span class=\"na\">title</span><span class=\"pi\">:</span> <span class=\"s\">The post title!</span><span class=\"na\">description</span><span class=\"pi\">:</span> <span class=\"s\">Something descriptive</span><span class=\"na\">summary</span><span class=\"pi\">:</span> <span class=\"s\">Something short</span><span class=\"na\">tags</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">any</span><span class=\"pi\">,</span> <span class=\"nv\">tags</span><span class=\"pi\">]</span><span class=\"na\">usemathjax</span><span class=\"pi\">:</span> <span class=\"no\">true</span><span class=\"nn\">---</span></code></pre></div></div>",
            "url": "https://btwiki.github.io//blog/2021/12/15/welcome",
            
            
            
            "tags": ["jekyll","blog"],
            
            "date_published": "2021-12-15T00:30:14+00:00",
            "date_modified": "2021-12-15T00:30:14+00:00",
            
                "author": "perry"
            
        }
    
    ]
}