<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Trigonometry on lavafroth</title><link>https://lavafroth.is-a.dev/tags/trigonometry/</link><description>Recent content in Trigonometry on lavafroth</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 21 Nov 2026 08:05:29 +0530</lastBuildDate><atom:link href="https://lavafroth.is-a.dev/tags/trigonometry/index.xml" rel="self" type="application/rss+xml"/><item><title>A Spongebob Shader</title><link>https://lavafroth.is-a.dev/post/a-spongebob-shader/</link><pubDate>Sat, 21 Nov 2026 08:05:29 +0530</pubDate><guid>https://lavafroth.is-a.dev/post/a-spongebob-shader/</guid><description>&lt;p&gt;I have been meaning to write about this for months now but it feels too trivial and I put it off.&#10;Well, here&amp;rsquo;s how I stumbled upon the spongebob shader: I was playing around with the equation of a squircle&lt;/p&gt;&#10;&lt;span class="katex"&gt;&lt;math xmlns="http://www.w3.org/1998/Math/MathML" display="block"&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding="application/x-tex"&gt; x^4 + y^4 = 1 &lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;p&gt;&lt;img src="../../spongebob-00.png" alt="A classic squircle"&gt;&lt;/p&gt;&#10;&lt;p&gt;when I factored out the x and y raised to the powers of 4 as a square of squares.&lt;/p&gt;&#10;&lt;span class="katex"&gt;&lt;math xmlns="http://www.w3.org/1998/Math/MathML" display="block"&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;⋅&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding="application/x-tex"&gt; x^2 \cdot x^2 + y^2 \cdot y^2 = 1 &lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;p&gt;It helps to think of each squared term like &lt;span class="katex"&gt;&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;annotation encoding="application/x-tex"&gt;x^2&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt; as energy or intensity from a physics perspective.&lt;/p&gt;</description></item></channel></rss>