Change to legacy_site url

This commit is contained in:
Peter 2023-10-30 02:22:03 +08:00
parent c3d5ee95d6
commit 1aa1efcc4f
6 changed files with 974 additions and 687 deletions

View File

@ -1,34 +1,95 @@
<a class="link" style="left:1%; top: 1%; position: absolute;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br><br><br>
<a
class="link"
style="left: 1%; top: 1%; position: absolute"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br /><br /><br />
These graphs are interactive - scroll controls the zoom (alternatively, hover over the bottom-left corner and use the magnifying glass to select an area). Use the home icon to reset the view.
These graphs are interactive - scroll controls the zoom (alternatively, hover
over the bottom-left corner and use the magnifying glass to select an area). Use
the home icon to reset the view.
<div style="text-align: center;">
<div style="text-align: center">
<h1>Absolute frequency</h1>
<iframe id="inlineFrameExample"
<iframe
id="inlineFrameExample"
title="Absolute frequency"
src="abs_freq.html"
onload="this.style.height=this.contentWindow.document.body.scrollHeight;this.style.width=this.contentWindow.document.body.scrollWidth;">
</iframe><br>
*Note that unfortunately the ore per chunk layer doesn't appear on the right y-axis. You can add the right axis by using the formula: y/(2*512/16)**2<br><br>
<hr>
onload="this.style.height=this.contentWindow.document.body.scrollHeight;this.style.width=this.contentWindow.document.body.scrollWidth;"
>
</iframe
><br />
*Note that unfortunately the ore per chunk layer doesn't appear on the right
y-axis. You can add the right axis by using the formula: y/(2*512/16)**2<br /><br />
<hr />
<h1>Relative frequency</h1>
<iframe id="inlineFrameExample"
<iframe
id="inlineFrameExample"
title="Relative frequency"
src="rel_freq.html"
onload="this.style.height=this.contentWindow.document.body.scrollHeight;this.style.width=this.contentWindow.document.body.scrollWidth;">
onload="this.style.height=this.contentWindow.document.body.scrollHeight;this.style.width=this.contentWindow.document.body.scrollWidth;"
>
</iframe>
</div><br>
<hr><br>
This text was copy-pasted from the github repo at https://github.com/peter-tanner/minecraft-ore-analysis
</div>
<br />
<hr />
<br />
This text was copy-pasted from the github repo at
https://github.com/peter-tanner/minecraft-ore-analysis
<h1>Minecraft ore analysis</h1>
<h2>Let&#39;s see how the new cave update ore generation compares to the old!</h2>
<h2>Go to <a href="https://peter-tanner.github.io/cave-update-ore-analysis">https://peter-tanner.github.io/cave-update-ore-analysis</a> for interactive graphs!</h2>
<h3>Both tests performed with seed 0 and single biome mode enabled (Extreme hills biome only, to include emerald ore statistics). Size of 1024*1024 scanned.</h3>
<h3>Original world files used for research are located at <a href="https://drive.google.com/drive/folders/1RsmfDp4nl5KaFWfCpL5sanK6cGUp45TO?usp=sharing">https://drive.google.com/drive/folders/1RsmfDp4nl5KaFWfCpL5sanK6cGUp45TO?usp=sharing</a></h3>
<h2>
Let&#39;s see how the new cave update ore generation compares to the old!
</h2>
<h2>
Go to
<a href="https://peter-tanner.github.io/legacy_site/cave-update-ore-analysis"
>https://peter-tanner.github.io/cave-update-ore-analysis</a
>
for interactive graphs!
</h2>
<h3>
Both tests performed with seed 0 and single biome mode enabled (Extreme hills
biome only, to include emerald ore statistics). Size of 1024*1024 scanned.
</h3>
<h3>
Original world files used for research are located at
<a
href="https://drive.google.com/drive/folders/1RsmfDp4nl5KaFWfCpL5sanK6cGUp45TO?usp=sharing"
>https://drive.google.com/drive/folders/1RsmfDp4nl5KaFWfCpL5sanK6cGUp45TO?usp=sharing</a
>
</h3>
<p>#</p>
<p>The scripts I&#39;ve created take advantage of a slightly modified <a href="https://github.com/DonoA/PyAnvilEditor">PyAnvilEditor</a> to parse the region files.</p>
<p>I&#39;ve replaced the code in the <code>276</code> (and everything else under <code>def close(self):</code>) of the <code>world</code> class of PyAnvilEditor with <code>true</code> - this is because I&#39;m not writing to the world file, I only intend to read from it. This saves a large amount of time spent writing that would go to waste.</p>
<p>To generate the graphs I&#39;ve used Matplotlib and I use mpld3 to convert these graphs into interactive html files for use on my website.</p>
<p>We load a large section of the world into memory - ideally, you want to set the block size to the maximum as this is quicker than loading small sections of the world repeatedly. Then we iterate through each coordinate in the block - this takes about 90 seconds with a block radius of <code>128</code>. At each coordinate we iterate each count for a tile in a particular layer. Once a whole block has been processed, we add it to the total.</p>
<p>The &#39;sum&#39; represents the total amount of a particular ore block within the whole sample (A 1024*1024 square meter area). The relative frequency represents the proportion of the total amount of a particular ore that occurs at a particular y-level.</p>
<p>This sample size can be improved on but it would obviously take longer given that my RAM is limited.</p>
<p>
The scripts I&#39;ve created take advantage of a slightly modified
<a href="https://github.com/DonoA/PyAnvilEditor">PyAnvilEditor</a> to parse
the region files.
</p>
<p>
I&#39;ve replaced the code in the <code>276</code> (and everything else under
<code>def close(self):</code>) of the <code>world</code> class of
PyAnvilEditor with <code>true</code> - this is because I&#39;m not writing to
the world file, I only intend to read from it. This saves a large amount of
time spent writing that would go to waste.
</p>
<p>
To generate the graphs I&#39;ve used Matplotlib and I use mpld3 to convert
these graphs into interactive html files for use on my website.
</p>
<p>
We load a large section of the world into memory - ideally, you want to set
the block size to the maximum as this is quicker than loading small sections
of the world repeatedly. Then we iterate through each coordinate in the block
- this takes about 90 seconds with a block radius of <code>128</code>. At each
coordinate we iterate each count for a tile in a particular layer. Once a
whole block has been processed, we add it to the total.
</p>
<p>
The &#39;sum&#39; represents the total amount of a particular ore block within
the whole sample (A 1024*1024 square meter area). The relative frequency
represents the proportion of the total amount of a particular ore that occurs
at a particular y-level.
</p>
<p>
This sample size can be improved on but it would obviously take longer given
that my RAM is limited.
</p>

View File

@ -15,11 +15,11 @@
made.</h2>
Stupid methane / thanos joke:<br>
<a href="https://peter-tanner.github.io/methanos/">https://peter-tanner.github.io/methanos</a><br>
<a href="https://peter-tanner.github.io/legacy_site/methanos/">https://peter-tanner.github.io/methanos</a><br>
<br>
EAifier - EAntEAr any tEAxt and have it EAmphasizEAd!<br>
<a href="https://peter-tanner.github.io/ea/">https://peter-tanner.github.io/ea</a><br>
<a href="https://peter-tanner.github.io/moneyfier/">https://peter-tanner.github.io/moneyfier</a><br>
<a href="https://peter-tanner.github.io/legacy_site/ea/">https://peter-tanner.github.io/ea</a><br>
<a href="https://peter-tanner.github.io/legacy_site/moneyfier/">https://peter-tanner.github.io/moneyfier</a><br>
<br>
WACE Stage 3/ATAR past papers archive - the most comprehensive archive of past papers (I think... :D )<br>
<a href="https://atar-wace-archive.github.io/">https://atar-wace-archive.github.io/</a><br>
@ -28,14 +28,14 @@
<a href="https://classpad.github.io/">https://classpad.github.io/</a><br>
<br>
Maths page - specialist and methods ramblings<br>
<a href="https://peter-tanner.github.io/maths">https://peter-tanner.github.io/maths</a><br>
<a href="https://peter-tanner.github.io/legacy_site/maths">https://peter-tanner.github.io/maths</a><br>
<br>
Programming ramblings - do not expect clean code here!<br>
<a href="https://peter-tanner.github.io/code">https://peter-tanner.github.io/code</a><br>
<a href="https://peter-tanner.github.io/legacy_site/code">https://peter-tanner.github.io/code</a><br>
<br>
Graphs/analysis showing differences in ore generation between 1.16.5 and cave update snapshots.<br>
<a
href="https://peter-tanner.github.io/cave-update-ore-analysis">https://peter-tanner.github.io/cave-update-ore-analysis</a><br>
href="https://peter-tanner.github.io/legacy_site/cave-update-ore-analysis">https://peter-tanner.github.io/cave-update-ore-analysis</a><br>
<br>
<br>
<br>

View File

@ -1,53 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<head>
<meta charset="UTF-8" />
<title>📝 2.5d rotations wtih shear transformation</title>
<meta name="description" content="2.5d rotations wtih shear transformation">
<meta name="viewport" content="width=device-width">
<meta
name="description"
content="2.5d rotations wtih shear transformation"
/>
<meta name="viewport" content="width=device-width" />
<title>MathJax example</title>
<script>
MathJax = {
tex: { macros: {cis: "\\mathop{\\rm{cis}}\\nolimits"} },
chtml: { displayAlign: 'center', scale: 1.1 }
}
tex: { macros: { cis: "\\mathop{\\rm{cis}}\\nolimits" } },
chtml: { displayAlign: "center", scale: 1.1 },
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/tikzjax/tikzjax.js"></script>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
<script>
hljs.initHighlightingOnLoad();
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.1/styles/default.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://tikzjax.com/v1/fonts.css">
</head>
<script src="/js/tikzjax/tikzjax.js"></script>
<script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.1/styles/default.min.css"
/>
<link rel="stylesheet" href="style.css" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
type="text/css"
href="https://tikzjax.com/v1/fonts.css"
/>
</head>
<body>
<body>
<center>
<h1>2.5d rotations with matrix transformations</h1>
<h3><s>(WACE) Mathematics Specialist ATAR</s><b style="color: red;">**</b></h3>
<h3>
<s>(WACE) Mathematics Specialist ATAR</s><b style="color: red">**</b>
</h3>
</center>
<div class="card bg-danger">
<div class="card-body" style="color: white;">
<center><h4><b>⚠WARNING⚠</b></h4></center>
<h5>At this point this article is probably outside of the curriculum. The transformations are in the curriculum, but most of this article is on a real math problem I've experienced which of course requires a bit of programming.</h5>
<div class="card-body" style="color: white">
<center>
<h4><b>⚠WARNING⚠</b></h4>
</center>
<h5>
At this point this article is probably outside of the curriculum. The
transformations are in the curriculum, but most of this article is on
a real math problem I've experienced which of course requires a bit of
programming.
</h5>
</div>
</div>
<a class="link" style="left:1%; top: 1%;" href="https://peter-tanner.github.io/maths">🔗 Back to MATHS home page</a><br>
<a class="link" style="left:1%; top: 1%;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br>
<a
class="link"
style="left: 1%; top: 1%"
href="https://peter-tanner.github.io/legacy_site/maths"
>🔗 Back to MATHS home page</a
><br />
<a
class="link"
style="left: 1%; top: 1%"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br />
Warning: This page requires javascript to render the math. This website runs better on a chromium browser. Untested on Firefox. <b>TikZ graphics may not render on other platforms!</b>
Warning: This page requires javascript to render the math. This website runs
better on a chromium browser. Untested on Firefox.
<b>TikZ graphics may not render on other platforms!</b>
<hr><br>
<hr />
<br />
<div class="card">
<div class="card-body">
<center><b>Introduction - What is '2.5d'?</b></center>
'2.5d' is not an actual dimension, but refers to techniques in computer graphics which aim to create the presence of 3d depth, but in a 2d level or environment.<br><br>
'2.5d' is not an actual dimension, but refers to techniques in computer
graphics which aim to create the presence of 3d depth, but in a 2d level
or environment.<br /><br />
<center>
<script type="text/tikz">
\begin{tikzpicture}[thick,scale=1, every node/.style={scale=1.9,inner sep=0pt}]
@ -63,20 +105,27 @@
\end{tikzpicture}
</script>
</center>
This box is a simplified example of 2.5d graphics.<br>
The gray on the front-facing side and the white top side is an example of shading, and creates the illusion of a 3d environment as a result of basic lighting. The camera is placed at a 45 degree angle, as we see equal proportions of the top and front faces of the box<br>
However, this is not real 3d graphics, as we're representing this box within a 2d space with only 2d position vectors.<br>
This box is a simplified example of 2.5d graphics.<br />
The gray on the front-facing side and the white top side is an example
of shading, and creates the illusion of a 3d environment as a result of
basic lighting. The camera is placed at a 45 degree angle, as we see
equal proportions of the top and front faces of the box<br />
However, this is not real 3d graphics, as we're representing this box
within a 2d space with only 2d position vectors.<br />
Therefore, this is 2.5d graphics.
</div>
</div>
<br>
<br />
<div class="card">
<div class="card-body">
<center><b>The problem</b></center>
I was making a mod for a game that added in rockets. The rockets took a ballistic trajectory to reach a target point<br>
Of course, because this is a 2.5d game I couldn't simply model the flight with the actual equations, because there is no concept of 'height' or 'altitude' in the game<br>
<br>
I was making a mod for a game that added in rockets. The rockets took a
ballistic trajectory to reach a target point<br />
Of course, because this is a 2.5d game I couldn't simply model the
flight with the actual equations, because there is no concept of
'height' or 'altitude' in the game<br />
<br />
<center>
<script type="text/tikz">
\begin{tikzpicture}[thick,scale=1, every node/.style={scale=1.9,inner sep=0pt}]
@ -89,7 +138,8 @@
\end{tikzpicture}
</script>
</center>
This parabola works fine for targets on the same \(\vec{j}\) as the silo<br>
This parabola works fine for targets on the same \(\vec{j}\) as the
silo<br />
What if we want a trajectory like this?
<center>
<script type="text/tikz">
@ -102,7 +152,8 @@
\end{tikzpicture}
</script>
</center>
We can try rotating the parabola, but that results in a trajectory which looks very unrealistic.
We can try rotating the parabola, but that results in a trajectory which
looks very unrealistic.
<center>
<script type="text/tikz">
\begin{tikzpicture}[thick,scale=1, every node/.style={scale=1.9,inner sep=0pt}]
@ -116,41 +167,34 @@
\end{tikzpicture}
</script>
</center>
The blue dashed parabola represents the pre-transformed trajectory (we are only given the distance \(d\) from target \(\mathbf{T}\) to silo \(\mathbf{S}\))<br>
The blue dashed parabola represents the pre-transformed trajectory (we
are only given the distance \(d\) from target \(\mathbf{T}\) to silo
\(\mathbf{S}\))<br />
<div class="alert alert-warning" role="alert">
<center>How this transformation is achieved [Advanced]</center>
<br>
Our transformation requires a shift. We can't just add two matrices of different dimensions so we need to somehow represent the shift as a matrix multiplication. For this we need a <b>homogeneous coordinate</b><br>
We represent a 2d vector as a 3d vector, but the \(\vec{k}\) component is a constant \(1\). This constant allows the addition of the shift through matrix multiplication. <br>
\[\mathbf{X}=\begin{bmatrix}
x_0 & x_1 & x_2 & x_3 & x_4 & x_5 & \dots \\
y_0 & y_1 & y_2 & y_3 & y_4 & y_5 & \dots \\
1 & 1 & 1 & 1 & 1 & 1 & \dots
\end{bmatrix}\]
In this case, we applied the following transformations to <b>rotate</b> then <b>translate</b> \(\mathbf{T}\) into 'inaccurate' trajectory, \(\mathbf{T'}\)
\begin{align}
\mathbf{X'} &= \begin{bmatrix}
1 & 0 & \Delta{x} \\
0 & 1 & \Delta{y} \\
0 & 0 & 1 \\
\end{bmatrix}\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & 0 \\
\sin(\theta) & \cos(\theta) & 0 \\
0 & 0 & 1 \\
\end{bmatrix}\mathbf{X}
\\\\
&= \begin{bmatrix}
1 & 0 & 1 \\
0 & 1 & 2 \\
0 & 0 & 1 \\
\end{bmatrix}\begin{bmatrix}
\cos(\frac{\pi}{6}) & -\sin(\frac{\pi}{6}) & 0 \\
\sin(\frac{\pi}{6}) & \cos(\frac{\pi}{6}) & 0 \\
0 & 0 & 1 \\
\end{bmatrix}\mathbf{X}
\end{align}
However, in reality I would just use a for loop and iterate through each pair of points.<br>
<br />
Our transformation requires a shift. We can't just add two matrices of
different dimensions so we need to somehow represent the shift as a
matrix multiplication. For this we need a <b>homogeneous coordinate</b
><br />
We represent a 2d vector as a 3d vector, but the \(\vec{k}\) component
is a constant \(1\). This constant allows the addition of the shift
through matrix multiplication. <br />
\[\mathbf{X}=\begin{bmatrix} x_0 & x_1 & x_2 & x_3 & x_4 & x_5 & \dots
\\ y_0 & y_1 & y_2 & y_3 & y_4 & y_5 & \dots \\ 1 & 1 & 1 & 1 & 1 & 1
& \dots \end{bmatrix}\] In this case, we applied the following
transformations to <b>rotate</b> then <b>translate</b> \(\mathbf{T}\)
into 'inaccurate' trajectory, \(\mathbf{T'}\) \begin{align}
\mathbf{X'} &= \begin{bmatrix} 1 & 0 & \Delta{x} \\ 0 & 1 & \Delta{y}
\\ 0 & 0 & 1 \\ \end{bmatrix}\begin{bmatrix} \cos(\theta) &
-\sin(\theta) & 0 \\ \sin(\theta) & \cos(\theta) & 0 \\ 0 & 0 & 1 \\
\end{bmatrix}\mathbf{X} \\\\ &= \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 2
\\ 0 & 0 & 1 \\ \end{bmatrix}\begin{bmatrix} \cos(\frac{\pi}{6}) &
-\sin(\frac{\pi}{6}) & 0 \\ \sin(\frac{\pi}{6}) & \cos(\frac{\pi}{6})
& 0 \\ 0 & 0 & 1 \\ \end{bmatrix}\mathbf{X} \end{align} However, in
reality I would just use a for loop and iterate through each pair of
points.<br />
<pre><code class="python">import math
import numpy as np
@ -171,50 +215,35 @@ for P in T:
end
# T_ is now our transformed matrix.
</code></pre>
</div>
</div>
</div>
<br>
<br />
<div class="card">
<div class="card-body">
<center><b>Shear matrices</b></center>
\begin{align}
\text{Parallel to the y-axis, Vertical shear}\quad
\mathbf{X'} &= \begin{bmatrix}
1 & 0\\
m & 1
\end{bmatrix}\mathbf{X}\\
&= \begin{bmatrix}
x\\
mx+y
\end{bmatrix} \\\\
\text{Parallel to the x-axis, Horizontal shear}\quad
\mathbf{X'} &= \begin{bmatrix}
1 & m\\
0 & 1
\end{bmatrix}\mathbf{X} \\
&= \begin{bmatrix}
x+my\\
y
\end{bmatrix}\\\\
\text{Where}\quad\mathbf{X} &= \begin{bmatrix}
x\\
y
\end{bmatrix}\\
\end{align}
\begin{align} \text{Parallel to the y-axis, Vertical shear}\quad
\mathbf{X'} &= \begin{bmatrix} 1 & 0\\ m & 1 \end{bmatrix}\mathbf{X}\\
&= \begin{bmatrix} x\\ mx+y \end{bmatrix} \\\\ \text{Parallel to the
x-axis, Horizontal shear}\quad \mathbf{X'} &= \begin{bmatrix} 1 & m\\ 0
& 1 \end{bmatrix}\mathbf{X} \\ &= \begin{bmatrix} x+my\\ y
\end{bmatrix}\\\\ \text{Where}\quad\mathbf{X} &= \begin{bmatrix} x\\ y
\end{bmatrix}\\ \end{align}
</div>
</div>
<br><hr><br>
<br />
<hr />
<br />
<div class="card">
<div class="card-body">
<center><b>The solution: shear matrices</b></center><br>
<center><b>The solution: shear matrices</b></center>
<br />
A shear matrix is better explained visually.
<center><script type="text/tikz">
<center>
<script type="text/tikz">
\begin{tikzpicture}[thick,scale=1, every node/.style={scale=1.9,inner sep=0pt}]
\draw[->] (-6, 1) -- (-1, 1) node[right] {$\vec{i}$};
\draw[->] (-6, 1) -- (-6, 6) node[above] {$\vec{j}$};
@ -224,27 +253,28 @@ end
\draw (-6,1) rectangle (-2,3);
\draw (6,3) -- (2,1) -- (2,3) -- (6,5) -- cycle;
\end{tikzpicture}
</script></center>
In this case we applied a vertical shear (parallel to the y-axis). Our x-values are the same, but our y-values have been transformed in a way that they match the line \(y'=mx+y\) (see the matrix representation).<br>
It has almost all of the properties required for our 2.5d rotation - we're only distorting the matrix on one axis and preserving the other. The only issue is that our transformed object will appear longer.<br>
<br>
In my case, I do not need to know the angle - I can use the gradient between the silo \(\mathbf{S}\) and target \(\mathbf{T}\).
\[m=\frac{\mathbf{S}_y-\mathbf{T}_y}{\mathbf{S}_x-\mathbf{T}_x}\]
\(m\) can also be obtained with a trig ratio, yielding the following shear transformation that involve angles rather than gradients.
\begin{align}
\text{Parallel to the y-axis, Vertical shear}\quad
\mathbf{X'} &= \begin{bmatrix}
1 & 0\\
\sin(\theta) & 1
\end{bmatrix}\mathbf{X}\\\\
\text{Parallel to the x-axis, Horizontal shear}\quad
\mathbf{X'} &= \begin{bmatrix}
1 & \sin(\theta)\\
0 & 1
\end{bmatrix}\mathbf{X}\\\\
\end{align}
To resolve our issue with the transformed object being 'lengthened', we need to scale it back.<br>
<center><script type="text/tikz">
</script>
</center>
In this case we applied a vertical shear (parallel to the y-axis). Our
x-values are the same, but our y-values have been transformed in a way
that they match the line \(y'=mx+y\) (see the matrix representation).<br />
It has almost all of the properties required for our 2.5d rotation -
we're only distorting the matrix on one axis and preserving the other.
The only issue is that our transformed object will appear longer.<br />
<br />
In my case, I do not need to know the angle - I can use the gradient
between the silo \(\mathbf{S}\) and target \(\mathbf{T}\).
\[m=\frac{\mathbf{S}_y-\mathbf{T}_y}{\mathbf{S}_x-\mathbf{T}_x}\] \(m\)
can also be obtained with a trig ratio, yielding the following shear
transformation that involve angles rather than gradients. \begin{align}
\text{Parallel to the y-axis, Vertical shear}\quad \mathbf{X'} &=
\begin{bmatrix} 1 & 0\\ \sin(\theta) & 1 \end{bmatrix}\mathbf{X}\\\\
\text{Parallel to the x-axis, Horizontal shear}\quad \mathbf{X'} &=
\begin{bmatrix} 1 & \sin(\theta)\\ 0 & 1 \end{bmatrix}\mathbf{X}\\\\
\end{align} To resolve our issue with the transformed object being
'lengthened', we need to scale it back.<br />
<center>
<script type="text/tikz">
\begin{tikzpicture}[thick,scale=1, every node/.style={scale=1.9,inner sep=0pt}]
\draw[->] (-6, 1) -- (-1, 1) node[right] {$\vec{i}$};
\draw[->] (-6, 1) -- (-6, 6) node[above] {$\vec{j}$};
@ -260,51 +290,44 @@ end
\node [label=below:{$\mathbf{P'_1}$}] at (2,1) {\textbullet};
\node [label=right:{$\mathbf{P'_2}$}] at (6,3) {\textbullet};
\end{tikzpicture}
</script></center>
</script>
</center>
Let's choose two points, \(\mathbf{P_1}\) and \(\mathbf{P_2}\).<br>
We obtain the original distance, \(d\) and the transformed distance, \(d'\)
\begin{align}
d &= \|\mathbf{P_1}-\mathbf{P_2}\| \\
&= \sqrt{(\mathbf{P_1}_x-\mathbf{P_2}_x)^2+(\mathbf{P_1}_y-\mathbf{P_2}_y)^2} \\
d' &= \|\mathbf{P'_1}-\mathbf{P'_2}\| \\
&= \sqrt{(\mathbf{P'_1}_x-\mathbf{P'_2}_x)^2+(\mathbf{P'_1}_y-\mathbf{P'_2}_y)^2}\\\\
\text{ where }\quad\mathbf{P'_1},\mathbf{P'_2} &= \begin{bmatrix}
1 & 0\\
\frac{\mathbf{S}_y-\mathbf{T}_y}{\mathbf{S}_x-\mathbf{T}_x} & 1
\end{bmatrix}\mathbf{P_1},\mathbf{P_2}\\
&= \begin{bmatrix}
1 & 0\\
\sin(\theta) & 1
\end{bmatrix}\mathbf{P_1},\mathbf{P_2}\\
\end{align}
Note that \(d\) is also the distance from the silo \(\mathbf{S}\) and target \(\mathbf{T}\)<br>
\(\mathbf{P_1}\) and \(\mathbf{P_2}\) are not the same as \(\mathbf{S}\) and \(\mathbf{T}\), because we've created these points with \(\begin{bmatrix}0\\0\end{bmatrix}\) as the origin, <b>not</b> \(\mathbf{S}\). We will translate all of the points later so that our starting point is \(\mathbf{S}\) after rotating.<br>
However, the distances are the same, so we might as well use \(\mathbf{S}\) and \(\mathbf{T}\) to calculate \(d\).
\[d = \|\mathbf{P_1}-\mathbf{P_2}\| = \|\mathbf{T}-\mathbf{S}\|\]
Our scale factor is simply the ratio between the two.
\begin{align}
s &= \frac{d}{d'} \\
&= \frac{\|\mathbf{T}-\mathbf{S}\|}{\|\mathbf{P'_1}-\mathbf{P'_2}\|}
\end{align}
Putting it all together, our 2.5d rotation is now:
\begin{align}
\mathbf{X'} &= s\begin{bmatrix}
1 & 0\\
m & 0
\end{bmatrix}\mathbf{X}\\
&= \frac{\|\mathbf{T}-\mathbf{S}\|}{\|\mathbf{P'_1}-\mathbf{P'_2}\|}\cdot\begin{bmatrix}
1 & 0\\
\frac{\mathbf{S}_y-\mathbf{T}_y}{\mathbf{S}_x-\mathbf{T}_x} & 1
\end{bmatrix}\mathbf{X}\\
\text{ or }\quad &= \frac{\|\mathbf{T}-\mathbf{S}\|}{\|\mathbf{P'_1}-\mathbf{P'_2}\|}\cdot\begin{bmatrix}
1 & 0\\
\sin(\theta) & 1
\end{bmatrix}\mathbf{X}\\\\
\end{align}
So we need a 'pre transformation' on two points, \(\mathbf{P_1}\) and \(\mathbf{P_2}\) in order to obtain our scale factor
<center><script type="text/tikz">
Let's choose two points, \(\mathbf{P_1}\) and \(\mathbf{P_2}\).<br />
We obtain the original distance, \(d\) and the transformed distance,
\(d'\) \begin{align} d &= \|\mathbf{P_1}-\mathbf{P_2}\| \\ &=
\sqrt{(\mathbf{P_1}_x-\mathbf{P_2}_x)^2+(\mathbf{P_1}_y-\mathbf{P_2}_y)^2}
\\ d' &= \|\mathbf{P'_1}-\mathbf{P'_2}\| \\ &=
\sqrt{(\mathbf{P'_1}_x-\mathbf{P'_2}_x)^2+(\mathbf{P'_1}_y-\mathbf{P'_2}_y)^2}\\\\
\text{ where }\quad\mathbf{P'_1},\mathbf{P'_2} &= \begin{bmatrix} 1 &
0\\ \frac{\mathbf{S}_y-\mathbf{T}_y}{\mathbf{S}_x-\mathbf{T}_x} & 1
\end{bmatrix}\mathbf{P_1},\mathbf{P_2}\\ &= \begin{bmatrix} 1 & 0\\
\sin(\theta) & 1 \end{bmatrix}\mathbf{P_1},\mathbf{P_2}\\ \end{align}
Note that \(d\) is also the distance from the silo \(\mathbf{S}\) and
target \(\mathbf{T}\)<br />
\(\mathbf{P_1}\) and \(\mathbf{P_2}\) are not the same as \(\mathbf{S}\)
and \(\mathbf{T}\), because we've created these points with
\(\begin{bmatrix}0\\0\end{bmatrix}\) as the origin,
<b>not</b> \(\mathbf{S}\). We will translate all of the points later so
that our starting point is \(\mathbf{S}\) after rotating.<br />
However, the distances are the same, so we might as well use
\(\mathbf{S}\) and \(\mathbf{T}\) to calculate \(d\). \[d =
\|\mathbf{P_1}-\mathbf{P_2}\| = \|\mathbf{T}-\mathbf{S}\|\] Our scale
factor is simply the ratio between the two. \begin{align} s &=
\frac{d}{d'} \\ &=
\frac{\|\mathbf{T}-\mathbf{S}\|}{\|\mathbf{P'_1}-\mathbf{P'_2}\|}
\end{align} Putting it all together, our 2.5d rotation is now:
\begin{align} \mathbf{X'} &= s\begin{bmatrix} 1 & 0\\ m & 0
\end{bmatrix}\mathbf{X}\\ &=
\frac{\|\mathbf{T}-\mathbf{S}\|}{\|\mathbf{P'_1}-\mathbf{P'_2}\|}\cdot\begin{bmatrix}
1 & 0\\ \frac{\mathbf{S}_y-\mathbf{T}_y}{\mathbf{S}_x-\mathbf{T}_x} & 1
\end{bmatrix}\mathbf{X}\\ \text{ or }\quad &=
\frac{\|\mathbf{T}-\mathbf{S}\|}{\|\mathbf{P'_1}-\mathbf{P'_2}\|}\cdot\begin{bmatrix}
1 & 0\\ \sin(\theta) & 1 \end{bmatrix}\mathbf{X}\\\\ \end{align} So we
need a 'pre transformation' on two points, \(\mathbf{P_1}\) and
\(\mathbf{P_2}\) in order to obtain our scale factor
<center>
<script type="text/tikz">
\begin{tikzpicture}[thick,scale=1, every node/.style={scale=1.9,inner sep=0pt}]
\draw[->] (-6, 1) -- (-1, 1) node[right] {$\vec{i}$};
\draw[->] (-6, 1) -- (-6, 6) node[above] {$\vec{j}$};
@ -320,8 +343,11 @@ end
\node [label=below:{$\mathbf{P'_1}$}] at (2,1) {\textbullet};
\node [label=right:{$\mathbf{P'_2}$}] at (6,3) {\textbullet};
\end{tikzpicture}
</script></center><br>
<center><script type="text/tikz">
</script>
</center>
<br />
<center>
<script type="text/tikz">
\begin{tikzpicture}[thick,scale=1, every node/.style={scale=1.9,inner sep=0pt}]
\draw[->] (-6, 1) -- (-1, 1) node[right] {$\vec{i}$};
\draw[->] (-6, 1) -- (-6, 6) node[above] {$\vec{j}$};
@ -337,15 +363,23 @@ end
\node [label=below:{$\mathbf{P''_1}$}] at (2,1) {\textbullet};
\node [label=right:{$\mathbf{P''_2}$}] at (5.36656315,2.68328157) {\textbullet};
\end{tikzpicture}
</script></center>
The limitation of this technique is that we need to perform the rotation about \(\begin{bmatrix}0\\0\end{bmatrix}\), the origin. After this we can translate the rotated matrix to match the silo and target location.<br>
You can use homogeneous coordinates to achieve this (see the yellow box earlier), or programatically do it.<br>
<br>
We also have to solve one last issue with this method: it only works within the domain \(\left(\frac{\pi}{2}, -\frac{\pi}{2}\right)\).<br>
This is because the gradient can only describe so much information.<br>
For instance, the line \(f(x)=1\cdot x\).<br>
We cannot tell if the line is going from the top-right to bottom-left, or bottom-left to top-right because it describes both situations.<br>
We need to adjust the signs on the shear matrix according to the quadrant our target is in.
</script>
</center>
The limitation of this technique is that we need to perform the rotation
about \(\begin{bmatrix}0\\0\end{bmatrix}\), the origin. After this we
can translate the rotated matrix to match the silo and target
location.<br />
You can use homogeneous coordinates to achieve this (see the yellow box
earlier), or programatically do it.<br />
<br />
We also have to solve one last issue with this method: it only works
within the domain \(\left(\frac{\pi}{2}, -\frac{\pi}{2}\right)\).<br />
This is because the gradient can only describe so much information.<br />
For instance, the line \(f(x)=1\cdot x\).<br />
We cannot tell if the line is going from the top-right to bottom-left,
or bottom-left to top-right because it describes both situations.<br />
We need to adjust the signs on the shear matrix according to the
quadrant our target is in.
<pre><code class="python">import math
import numpy as np
@ -416,7 +450,18 @@ X_ = s * np.matmul(SHEAR, X) + S # shear, then scale every point by s.
</code></pre>
</div>
</div>
<br>
<a class="link" style="left:1%; bottom: 1%;" href="https://peter-tanner.github.io/maths">🔗 Back to MATHS home page</a><br>
<a class="link" style="left:1%; bottom: 1%;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br>
</body>
<br />
<a
class="link"
style="left: 1%; bottom: 1%"
href="https://peter-tanner.github.io/legacy_site/maths"
>🔗 Back to MATHS home page</a
><br />
<a
class="link"
style="left: 1%; bottom: 1%"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br />
</body>
</html>

View File

@ -1,121 +1,168 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<head>
<meta charset="UTF-8" />
<title>📝 Maths!</title>
<meta name="description" content="year 12 WACE specialist ATAR stuff">
<meta name="viewport" content="width=device-width">
<meta name="description" content="year 12 WACE specialist ATAR stuff" />
<meta name="viewport" content="width=device-width" />
<title>MathJax example</title>
<script>
MathJax = {
tex: { macros: {cis: "\\mathop{\\rm{cis}}\\nolimits"} },
chtml: { displayAlign: 'center', scale: 1.1 }
}
tex: { macros: { cis: "\\mathop{\\rm{cis}}\\nolimits" } },
chtml: { displayAlign: "center", scale: 1.1 },
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
</head>
<script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>
<link rel="stylesheet" href="style.css" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
crossorigin="anonymous"
/>
</head>
<body>
<body>
<center>
<h1>A little rant on cis notation</h1>
</center>
<a class="link" style="left:1%; top: 1%;" href="https://peter-tanner.github.io/maths">🔗 Back to MATHS home page</a><br>
<a class="link" style="left:1%; top: 1%;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br>
<a
class="link"
style="left: 1%; top: 1%"
href="https://peter-tanner.github.io/legacy_site/maths"
>🔗 Back to MATHS home page</a
><br />
<a
class="link"
style="left: 1%; top: 1%"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br />
Warning: This page requires javascript to render the math.
<hr><br>
This is a rant on why I think \(e^{\pi\theta}\) should have been the standard in WA specialist. All opinions are my own, and yes, this is an incredibly nitpicky topic. And no, I don't expect any changes but if it occurs I'll be pleasantly surprised.<br>
<hr />
<br />
This is a rant on why I think \(e^{\pi\theta}\) should have been the
standard in WA specialist. All opinions are my own, and yes, this is an
incredibly nitpicky topic. And no, I don't expect any changes but if it
occurs I'll be pleasantly surprised.<br />
To many readers, this wouldn't be a debate because you'd be there going, "what the heck is \(\cis\)?"<br>
This is the first downside of \(\cis\) notation: it is less known and sparsely used compared to Euler's formula. \(\cis\) is the mathematical equivalent of the imperial system.<br>
To answer the question, \(\cis\) is an abbreviation for "\(\cos\) plus \(i\sin\)". This is actually one big thing I like about \(\cis\) notation, in that it's an abbreviation which is easy to remember. In comparison, euler's formula doesn't really make that much sense, you just have to accept that it represents "\(\cos\) plus \(i\sin\)".<br>
This pro becomes less significant when you realize that a complex number can be expressed as a vector, and we all know that from the unit circle that \(\cos\) goes on the \(x\) axis, and \(\sin\) on the \(y\) axis. Likewise, \(\cos\) goes on the real axis and \(\sin\) on the imaginary axis.
To many readers, this wouldn't be a debate because you'd be there going,
"what the heck is \(\cis\)?"<br />
This is the first downside of \(\cis\) notation: it is less known and
sparsely used compared to Euler's formula. \(\cis\) is the mathematical
equivalent of the imperial system.<br />
To answer the question, \(\cis\) is an abbreviation for "\(\cos\) plus
\(i\sin\)". This is actually one big thing I like about \(\cis\) notation,
in that it's an abbreviation which is easy to remember. In comparison,
euler's formula doesn't really make that much sense, you just have to accept
that it represents "\(\cos\) plus \(i\sin\)".<br />
This pro becomes less significant when you realize that a complex number can
be expressed as a vector, and we all know that from the unit circle that
\(\cos\) goes on the \(x\) axis, and \(\sin\) on the \(y\) axis. Likewise,
\(\cos\) goes on the real axis and \(\sin\) on the imaginary axis.
<div class="card">
<div class="card-body">
<center>\(\cis\) notation of a complex number, \(z\)</center>
\[\boxed{\|z\|\cdot \cis(\theta) = \|z\|\cdot\left[\cos(\theta)+i\sin(\theta)\right]}\]<br>
\[\boxed{\|z\|\cdot \cis(\theta) =
\|z\|\cdot\left[\cos(\theta)+i\sin(\theta)\right]}\]<br />
<center>Euler's formula</center>
\[\boxed{\|z\|\cdot e^{i\theta} = \|z\|\cdot\left[\cos(\theta)+i\sin(\theta)\right]}\]
\[\boxed{\|z\|\cdot e^{i\theta} =
\|z\|\cdot\left[\cos(\theta)+i\sin(\theta)\right]}\]
</div>
</div>
My real issue with \(\cis\) notation is that it's not as obvious what certain operations do. You can't use previous knowledge acquired from index laws. By using \(\cis\), you are restricting yourself and you lose a lot of the complexity (Haha get it? complex? okay...) that is possible with the polar form.<br>
My real issue with \(\cis\) notation is that it's not as obvious what
certain operations do. You can't use previous knowledge acquired from index
laws. By using \(\cis\), you are restricting yourself and you lose a lot of
the complexity (Haha get it? complex? okay...) that is possible with the
polar form.<br />
<div class="card">
<div class="card-body">
<center><b>Question 1</b>: Express \(i^i\) in the form \(\alpha+\beta i\)</center>
<center>
<b>Question 1</b>: Express \(i^i\) in the form \(\alpha+\beta i\)
</center>
For any method, the first step is to turn this into polar form.
\begin{align}
\text{Define }z&=i\\
\implies&{\|z\| = 1}\\
\implies&{\theta = \frac{\pi}{2}}
\end{align}
Now we want to evaluate \(z^z\)<br>
Let's try get somewhere with \(\cis\).
\begin{align}
z &= 1\cdot\cis\left(\frac{\pi}{2}\right)\\
&= \cis\left(\frac{\pi}{2}\right)\\
z^z &= \cis\left(\frac{\pi}{2}\right)^{\cis\left(\frac{\pi}{2}\right)}\\
&= \cis\left(\frac{\pi}{2}\right)^i\\
&= \cis\left(i\frac{\pi}{2}\right)\\
&= ?
\end{align}
Now what? We have an \(i\) in the phase.<br>
It would be much easier if this was a complex exponential!
\begin{align}
z &= 1\cdot e^{i\frac{\pi}{2}}\\
&= e^{i\frac{\pi}{2}}\\
z^z &= {\left[e^{i\frac{\pi}{2}}\right]}^{e^{i\frac{\pi}{2}}}\\
&= {\left[e^{i\frac{\pi}{2}}\right]}^{i}\\
&= {\left[e^{i\cdot i\frac{\pi}{2}}\right]}\\
&= e^{-\frac{\pi}{2}}
\end{align}
Wow! And it's neatly packaged as an exponent!
\begin{align} \text{Define }z&=i\\ \implies&{\|z\| = 1}\\
\implies&{\theta = \frac{\pi}{2}} \end{align} Now we want to evaluate
\(z^z\)<br />
Let's try get somewhere with \(\cis\). \begin{align} z &=
1\cdot\cis\left(\frac{\pi}{2}\right)\\ &=
\cis\left(\frac{\pi}{2}\right)\\ z^z &=
\cis\left(\frac{\pi}{2}\right)^{\cis\left(\frac{\pi}{2}\right)}\\ &=
\cis\left(\frac{\pi}{2}\right)^i\\ &= \cis\left(i\frac{\pi}{2}\right)\\
&= ? \end{align} Now what? We have an \(i\) in the phase.<br />
It would be much easier if this was a complex exponential! \begin{align}
z &= 1\cdot e^{i\frac{\pi}{2}}\\ &= e^{i\frac{\pi}{2}}\\ z^z &=
{\left[e^{i\frac{\pi}{2}}\right]}^{e^{i\frac{\pi}{2}}}\\ &=
{\left[e^{i\frac{\pi}{2}}\right]}^{i}\\ &= {\left[e^{i\cdot
i\frac{\pi}{2}}\right]}\\ &= e^{-\frac{\pi}{2}} \end{align} Wow! And
it's neatly packaged as an exponent!
</div>
</div>
I understand the use of \(\cis\) to represent a complex number as a polar coordinate if your curriculum doesn't understand the concept of calculus when the concept of complex numbers is being taught<br>
But \(e\) (Euler's number) is a concept taught in year 12 methods. And year 12 methods is a prerequisite for year 12 specialist. So students should be familiar with \(e\) and calculus, so why isn't it being used?<br><br>
My argument isn't really that strong, I recognise that. Just wanted to go on a 3am MathRant™ :)<br><br>
I understand the use of \(\cis\) to represent a complex number as a polar
coordinate if your curriculum doesn't understand the concept of calculus
when the concept of complex numbers is being taught<br />
But \(e\) (Euler's number) is a concept taught in year 12 methods. And year
12 methods is a prerequisite for year 12 specialist. So students should be
familiar with \(e\) and calculus, so why isn't it being used?<br /><br />
My argument isn't really that strong, I recognise that. Just wanted to go on
a 3am MathRant™ :)<br /><br />
<div class="card">
<div class="card-body">
<center><b>Bonus Math Tip</b>: Derive the double angle identities.</center>
No need for Euler's formula here, use \(\cis\) for this trick if you want.<br>
Not sure why you'd need to know this - sure, in methods these identities aren't given on the formula sheet but they are in specialist. Methods seems to stick to the basic identities such as the 2As and pythagorean, but you're expected to remember them. I always just put these identities on my notes.<br>
Use this trick to derive any set of angle identities (triple, quadruple, etc.). Have fun expanding brackets though.<br><br>
Let the first angle be \(A\) and the second angle \(B\).
\begin{align}
e^{\pi A}\cdot e^{\pi B} &= \left[\cos(A)+i\sin(A)\right]\cdot\left[\cos(B)+i\sin(B)\right]\\
e^{\pi (A+B)} &= \cos(A)\cos(B) + i\cos(A)\sin(B) + i\sin(A)\cos(B) + i^2\sin(A)\sin(B)\\
\cos(A+B) + i\sin(A+B) &= \left[\cos(A)\cos(B) - \sin(A)\sin(B)\right] + i\cdot\left[\cos(A)\sin(B) + \sin(A)\cos(B) \right]
\end{align}
Consider the real and complex components of this equation to get the two identities.
\begin{cases}
\text{Real:}&\cos(A+B) = \cos(A)\cos(B) - \sin(A)\sin(B)\\
\text{Imaginary:}&\sin(A+B) = \cos(A)\sin(B) + \sin(A)\cos(B)
\end{cases}
And you can repeat this all again for negative second angle.
\begin{align}
e^{\pi A}\cdot e^{\pi (-B)} &= \left[\cos(A)+i\sin(A)\right]\cdot\left[\cos(-B)+i\sin(-B)\right]\\
&= \left[\cos(A)+i\sin(A)\right]\cdot\left[\cos(B)-i\sin(B)\right]\\
e^{\pi (A-B)} &= \cos(A)\cos(B)-i\cos(A)\sin(B)+i\sin(A)\cos(B)-i^2\sin(A)\sin(B)\\
\cos(A-B) + i\sin(A-B) &= \left[\cos(A)\cos(B) + \sin(A)\sin(B)\right] + i\cdot\left[\sin(A)\cos(B)-\cos(A)\sin(B)\right]
\end{align}
\begin{cases}
\text{Real:}&\cos(A-B) = \cos(A)\cos(B) + \sin(A)\sin(B)\\
\text{Imaginary:}&\sin(A-B) = \sin(A)\cos(B)-\cos(A)\sin(B)
\end{cases}
<center>
<b>Bonus Math Tip</b>: Derive the double angle identities.
</center>
No need for Euler's formula here, use \(\cis\) for this trick if you
want.<br />
Not sure why you'd need to know this - sure, in methods these identities
aren't given on the formula sheet but they are in specialist. Methods
seems to stick to the basic identities such as the 2As and pythagorean,
but you're expected to remember them. I always just put these identities
on my notes.<br />
Use this trick to derive any set of angle identities (triple, quadruple,
etc.). Have fun expanding brackets though.<br /><br />
Let the first angle be \(A\) and the second angle \(B\). \begin{align}
e^{\pi A}\cdot e^{\pi B} &=
\left[\cos(A)+i\sin(A)\right]\cdot\left[\cos(B)+i\sin(B)\right]\\ e^{\pi
(A+B)} &= \cos(A)\cos(B) + i\cos(A)\sin(B) + i\sin(A)\cos(B) +
i^2\sin(A)\sin(B)\\ \cos(A+B) + i\sin(A+B) &= \left[\cos(A)\cos(B) -
\sin(A)\sin(B)\right] + i\cdot\left[\cos(A)\sin(B) + \sin(A)\cos(B)
\right] \end{align} Consider the real and complex components of this
equation to get the two identities. \begin{cases} \text{Real:}&\cos(A+B)
= \cos(A)\cos(B) - \sin(A)\sin(B)\\ \text{Imaginary:}&\sin(A+B) =
\cos(A)\sin(B) + \sin(A)\cos(B) \end{cases} And you can repeat this all
again for negative second angle. \begin{align} e^{\pi A}\cdot e^{\pi
(-B)} &=
\left[\cos(A)+i\sin(A)\right]\cdot\left[\cos(-B)+i\sin(-B)\right]\\ &=
\left[\cos(A)+i\sin(A)\right]\cdot\left[\cos(B)-i\sin(B)\right]\\ e^{\pi
(A-B)} &=
\cos(A)\cos(B)-i\cos(A)\sin(B)+i\sin(A)\cos(B)-i^2\sin(A)\sin(B)\\
\cos(A-B) + i\sin(A-B) &= \left[\cos(A)\cos(B) + \sin(A)\sin(B)\right] +
i\cdot\left[\sin(A)\cos(B)-\cos(A)\sin(B)\right] \end{align}
\begin{cases} \text{Real:}&\cos(A-B) = \cos(A)\cos(B) + \sin(A)\sin(B)\\
\text{Imaginary:}&\sin(A-B) = \sin(A)\cos(B)-\cos(A)\sin(B) \end{cases}
</div>
</div>
<br>
<a class="link" style="left:1%; bottom: 1%;" href="https://peter-tanner.github.io/maths">🔗 Back to MATHS home page</a><br>
<a class="link" style="left:1%; bottom: 1%;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br>
</body>
<br />
<a
class="link"
style="left: 1%; bottom: 1%"
href="https://peter-tanner.github.io/legacy_site/maths"
>🔗 Back to MATHS home page</a
><br />
<a
class="link"
style="left: 1%; bottom: 1%"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br />
</body>
</html>

View File

@ -1,240 +1,337 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<head>
<meta charset="UTF-8" />
<title>📝 De Moivre's theorem</title>
<meta name="description" content="De Moivre's theorem stuff - year 12 WACE specialist ATAR">
<meta name="viewport" content="width=device-width">
<meta
name="description"
content="De Moivre's theorem stuff - year 12 WACE specialist ATAR"
/>
<meta name="viewport" content="width=device-width" />
<title>MathJax example</title>
<script>
MathJax = {
tex: { macros: {cis: "\\mathop{\\rm{cis}}\\nolimits"} },
chtml: { displayAlign: 'center', scale: 1.1 }
}
tex: { macros: { cis: "\\mathop{\\rm{cis}}\\nolimits" } },
chtml: { displayAlign: "center", scale: 1.1 },
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
</head>
<script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>
<link rel="stylesheet" href="style.css" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
crossorigin="anonymous"
/>
</head>
<body>
<body>
<center>
<h1>Polar form and De Moivre's identity</h1>
<h3>(WACE) Mathematics Specialist ATAR</h3>
</center>
<a class="link" style="left:1%; top: 1%;" href="https://peter-tanner.github.io/maths">🔗 Back to MATHS home page</a><br>
<a class="link" style="left:1%; top: 1%;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br>
<a
class="link"
style="left: 1%; top: 1%"
href="https://peter-tanner.github.io/legacy_site/maths"
>🔗 Back to MATHS home page</a
><br />
<a
class="link"
style="left: 1%; top: 1%"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br />
Warning: This page requires javascript to render the math.
<hr><br>
<hr />
<br />
<div class="card">
<div class="card-body">
<center>De Moivre's identity</center>
\[\boxed{\left[r\cdot \cis(\theta)\right]^n = r^n\cdot\cis(\theta\cdot n)}\]
where \(\cis(\theta) = \cos(\theta) + i\cdot\sin(\theta)\)<br>
\[\boxed{\left[r\cdot \cis(\theta)\right]^n = r^n\cdot\cis(\theta\cdot
n)}\] where \(\cis(\theta) = \cos(\theta) + i\cdot\sin(\theta)\)<br />
</div>
</div>
<p>
The identity is more obvious when we use Euler's formula, \(\boxed{e^{i\theta} = \cos(\theta) + i\cdot\sin(\theta) = \cis(\theta)}\)<br>
The identity is more obvious when we use Euler's formula,
\(\boxed{e^{i\theta} = \cos(\theta) + i\cdot\sin(\theta) =
\cis(\theta)}\)<br />
This formula doesn't appear to be taught in the WA curriculum.
\begin{align}
\left[r\cdot e^{i\theta}\right]^n &= r^n\cdot\left[e^{i\theta}\right]^n\\
&= r^n\cdot e^{i(\theta n)} \\
&= r^n\cdot\cis(\theta\cdot n) \\
\end{align}
\begin{align} \left[r\cdot e^{i\theta}\right]^n &=
r^n\cdot\left[e^{i\theta}\right]^n\\ &= r^n\cdot e^{i(\theta n)} \\ &=
r^n\cdot\cis(\theta\cdot n) \\ \end{align}
</p>
<div class="card">
<div class="card-body">
<center>Polar form rules: they're on the formula sheet so <b>don't put them on your notes!</b></center>
\begin{align}
z_1\cdot z_2 &= r_1\cdot r_2 \cdot \cis(\theta_1 + \theta_2) \\
\frac{z_1}{z_2} &= \frac{r_1}{r_2} \cdot \cis(\theta_1 - \theta_2)\\
\cis(\theta_1 + \theta_2) &= \cis(\theta_1)\cdot\cis(\theta_2) \\
\cis(-\theta) &= \frac{1}{\cis(\theta)} \\
\overline{\cis(\theta)} &= \cis(-\theta)
<center>
Polar form rules: they're on the formula sheet so
<b>don't put them on your notes!</b>
</center>
\begin{align} z_1\cdot z_2 &= r_1\cdot r_2 \cdot \cis(\theta_1 +
\theta_2) \\ \frac{z_1}{z_2} &= \frac{r_1}{r_2} \cdot \cis(\theta_1 -
\theta_2)\\ \cis(\theta_1 + \theta_2) &=
\cis(\theta_1)\cdot\cis(\theta_2) \\ \cis(-\theta) &=
\frac{1}{\cis(\theta)} \\ \overline{\cis(\theta)} &= \cis(-\theta)
\end{align}
</div>
</div>
<hr>
<hr />
<center><b>Question 1</b></center>
<hr>
<hr />
The polar form of a complex number is useful because of its properties.
<center>
Simplify \(\boxed{\frac{(i+1)^{2020}}{(i-1)^{2020}}}\)&nbsp;&nbsp;&nbsp;(no calculator)
Simplify
\(\boxed{\frac{(i+1)^{2020}}{(i-1)^{2020}}}\)&nbsp;&nbsp;&nbsp;(no
calculator)
</center>
Some defining may be useful right now.
\begin{align}
z_0&=i+1 \\
z_1&=i-1 \\
\end{align}
First steps to convert to polar form is always to obtain the modulus and argument of the complex number
\begin{align}
\lvert z_0 \rvert &= \sqrt{1^2 + 1^2} = \sqrt{2} \\
\lvert z_1 \rvert &= \sqrt{1^2 + 1^2} = \sqrt{2} \\
\arg(z_0) &= \arctan\left(\frac{1}{1}\right) = \frac{\pi}{2} \\
\arg(z_1) &= \arctan\left(\frac{-1}{1}\right) = -\frac{\pi}{2} \\
\therefore z_0 &= \sqrt{2}\cdot\cis\left(\frac{\pi}{2}\right) \\
z_1 &= \sqrt{2}\cdot\cis\left(-\frac{\pi}{2}\right) \\
\end{align}
So our original equation becomes:
\begin{align}
\frac{(i+1)^{2020}}{(i-1)^{2020}} = \frac{z_0^{\phantom{0}2020}}{z_1^{\phantom{0}2020}} &= \frac{\left[\sqrt{2}\cdot\cis(\frac{\pi}{2})\right]^{2020}}{\left[\sqrt{2}\cdot\cis(-\frac{\pi}{2})\right]^{2020}} \\
&= \frac{\sqrt{2}^{2020}}{\sqrt{2}^{2020}}\cdot\frac{\cis(\frac{\pi}{2})^{2020}}{\cis(-\frac{\pi}{2})^{2020}} \\
&= \frac{\cis(\frac{\pi}{2})^{2020}}{\cis(-\frac{\pi}{2})^{2020}} \\
\end{align}
Let's apply De Moivre's theorem.
\begin{align}
\frac{(i+1)^{2020}}{(i-1)^{2020}} = \frac{\cis(2020\cdot\frac{\pi}{2})}{\cis(-2020\cdot\frac{\pi}{2})} \\
&= \frac{\cis(1010\cdot\pi)}{\cis(-1010\cdot\pi)}
\end{align}
We have the useful formula, \(\boxed{\frac{\cis(\alpha)}{\cis(\beta)} = \cis(\alpha-\beta)}\). Let's apply it!
\begin{align}
\frac{(i+1)^{2020}}{(i-1)^{2020}} &= \cis\left[1010\cdot\pi-\left(-1010\cdot\pi\right)\right] \\
&= \cis\left[1010\cdot\pi+1010\cdot\pi\right] \\
&= \cis\left[2020\cdot\pi\right] \\
&= \cis\left[1010\cdot2\pi\right] \\
&= \cis\left[2\pi\right] \\
&= 1 \\
\end{align}
All <b>simp</b>lified.<br>
This question forces you to use \(\cis\) due to the large power. If we had, say, \(\frac{(i+1)}{(i-1)}\), we could simply multiply the top and bottom by \((i+1)\), expand and split the fraction.
<hr>
Some defining may be useful right now. \begin{align} z_0&=i+1 \\ z_1&=i-1 \\
\end{align} First steps to convert to polar form is always to obtain the
modulus and argument of the complex number \begin{align} \lvert z_0 \rvert
&= \sqrt{1^2 + 1^2} = \sqrt{2} \\ \lvert z_1 \rvert &= \sqrt{1^2 + 1^2} =
\sqrt{2} \\ \arg(z_0) &= \arctan\left(\frac{1}{1}\right) = \frac{\pi}{2} \\
\arg(z_1) &= \arctan\left(\frac{-1}{1}\right) = -\frac{\pi}{2} \\ \therefore
z_0 &= \sqrt{2}\cdot\cis\left(\frac{\pi}{2}\right) \\ z_1 &=
\sqrt{2}\cdot\cis\left(-\frac{\pi}{2}\right) \\ \end{align} So our original
equation becomes: \begin{align} \frac{(i+1)^{2020}}{(i-1)^{2020}} =
\frac{z_0^{\phantom{0}2020}}{z_1^{\phantom{0}2020}} &=
\frac{\left[\sqrt{2}\cdot\cis(\frac{\pi}{2})\right]^{2020}}{\left[\sqrt{2}\cdot\cis(-\frac{\pi}{2})\right]^{2020}}
\\ &=
\frac{\sqrt{2}^{2020}}{\sqrt{2}^{2020}}\cdot\frac{\cis(\frac{\pi}{2})^{2020}}{\cis(-\frac{\pi}{2})^{2020}}
\\ &= \frac{\cis(\frac{\pi}{2})^{2020}}{\cis(-\frac{\pi}{2})^{2020}} \\
\end{align} Let's apply De Moivre's theorem. \begin{align}
\frac{(i+1)^{2020}}{(i-1)^{2020}} =
\frac{\cis(2020\cdot\frac{\pi}{2})}{\cis(-2020\cdot\frac{\pi}{2})} \\ &=
\frac{\cis(1010\cdot\pi)}{\cis(-1010\cdot\pi)} \end{align} We have the
useful formula, \(\boxed{\frac{\cis(\alpha)}{\cis(\beta)} =
\cis(\alpha-\beta)}\). Let's apply it! \begin{align}
\frac{(i+1)^{2020}}{(i-1)^{2020}} &=
\cis\left[1010\cdot\pi-\left(-1010\cdot\pi\right)\right] \\ &=
\cis\left[1010\cdot\pi+1010\cdot\pi\right] \\ &=
\cis\left[2020\cdot\pi\right] \\ &= \cis\left[1010\cdot2\pi\right] \\ &=
\cis\left[2\pi\right] \\ &= 1 \\ \end{align} All <b>simp</b>lified.<br />
This question forces you to use \(\cis\) due to the large power. If we had,
say, \(\frac{(i+1)}{(i-1)}\), we could simply multiply the top and bottom by
\((i+1)\), expand and split the fraction.
<hr />
<center><b>Question 2</b></center>
<hr>
<hr />
Let's try something harder.
<p>
<center>
Express \(\boxed{\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right]}\) in the form \(\boxed{r\cdot\cis(\alpha)}\)&nbsp;&nbsp;&nbsp;(no calculator)
Express
\(\boxed{\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right]}\)
in the form \(\boxed{r\cdot\cis(\alpha)}\)&nbsp;&nbsp;&nbsp;(no
calculator)
</center>
What can we do? Firstly, we can expand the capital pi \(\Pi\) to reveal the terms.
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] = \cis\left(\frac{\pi}{2}\right) \times 2\cis\left(\frac{\pi}{2}\right)^2 \times 3\cis\left(\frac{\pi}{2}\right)^3 \times [\dots] \times 2020\cis\left(\frac{\pi}{2}\right)^{2020}\]
Secondly, we can recognise that we can bring the coefficients together and use our identity to bring the power \(n\) into the angle
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] = \left(1\times 2\times 3\times [\dots]\times 2020 \right)\times \cis\left(\frac{\pi}{2}\right) \times \cis\left(2\cdot\frac{\pi}{2}\right) \times \cis\left(3\cdot\frac{\pi}{2}\right) \times [\dots] \times \cis\left(2020\cdot\frac{\pi}{2}\right)\]
The coefficients together form a factorial! We can express this as:
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] = 2020!\times \cis\left(\frac{\pi}{2}\right) \times \cis\left(2\cdot\frac{\pi}{2}\right) \times \cis\left(3\cdot\frac{\pi}{2}\right) \times [\dots] \times \cis\left(2020\cdot\frac{\pi}{2}\right)\]
OK, let's now bring the angles together. \(\cis(\alpha)\times\cis(\beta) = \cis(\alpha + \beta)\)
What can we do? Firstly, we can expand the capital pi \(\Pi\) to reveal
the terms.
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] =
\cis\left(\frac{\pi}{2}\right) \times 2\cis\left(\frac{\pi}{2}\right)^2
\times 3\cis\left(\frac{\pi}{2}\right)^3 \times [\dots] \times
2020\cis\left(\frac{\pi}{2}\right)^{2020}\] Secondly, we can recognise
that we can bring the coefficients together and use our identity to bring
the power \(n\) into the angle
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] =
\left(1\times 2\times 3\times [\dots]\times 2020 \right)\times
\cis\left(\frac{\pi}{2}\right) \times \cis\left(2\cdot\frac{\pi}{2}\right)
\times \cis\left(3\cdot\frac{\pi}{2}\right) \times [\dots] \times
\cis\left(2020\cdot\frac{\pi}{2}\right)\] The coefficients together form a
factorial! We can express this as:
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] =
2020!\times \cis\left(\frac{\pi}{2}\right) \times
\cis\left(2\cdot\frac{\pi}{2}\right) \times
\cis\left(3\cdot\frac{\pi}{2}\right) \times [\dots] \times
\cis\left(2020\cdot\frac{\pi}{2}\right)\] OK, let's now bring the angles
together. \(\cis(\alpha)\times\cis(\beta) = \cis(\alpha + \beta)\)
\begin{align}
\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &= 2020!\times \cis\left(\frac{\pi}{2} + 2\cdot\frac{\pi}{2} + 3\cdot\frac{\pi}{2} + [\dots] + 2020\cdot\frac{\pi}{2}\right) \\
&= 2020!\times \cis\left((1 + 2 + 3 + [\dots] + 2020)\cdot\frac{\pi}{2}\right)
\end{align}
Great! This is looking like the form we need. All that's left is to use our triangular number (sum) formula to calculate the sum of the coefficient of \(\frac{\pi}{2}\) <br>
\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &=
2020!\times \cis\left(\frac{\pi}{2} + 2\cdot\frac{\pi}{2} +
3\cdot\frac{\pi}{2} + [\dots] + 2020\cdot\frac{\pi}{2}\right) \\ &=
2020!\times \cis\left((1 + 2 + 3 + [\dots] +
2020)\cdot\frac{\pi}{2}\right) \end{align} Great! This is looking like the
form we need. All that's left is to use our triangular number (sum)
formula to calculate the sum of the coefficient of \(\frac{\pi}{2}\)
<br />
The formula by the way is: \(\boxed{\sum_{k=1}^n k = \frac{n(n+1)}{2}}\)
\begin{align}
\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &= 2020!\times \cis\left(\frac{2020(2020+1)}{2}\cdot\frac{\pi}{2}\right) \\
&= 2020!\times \cis\left(1020605\pi\right)
\end{align}
By recognising that \(\cis\) is periodic, we can reduce the angle size to simplify further. Because \(1020605=2n+1\), where \(n\) is an integer, it is odd and we can reduce the angle to simply \(\pi\).
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] = 2020!\times \cis\left(\pi\right)\]
OK, we got it in the form \(r\cdot\cis(\alpha)\) as required. \(2020!\), by the way is a very large number. Vsauce already has a video on \(52!\) which is already very large.
\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &=
2020!\times \cis\left(\frac{2020(2020+1)}{2}\cdot\frac{\pi}{2}\right) \\
&= 2020!\times \cis\left(1020605\pi\right) \end{align} By recognising that
\(\cis\) is periodic, we can reduce the angle size to simplify further.
Because \(1020605=2n+1\), where \(n\) is an integer, it is odd and we can
reduce the angle to simply \(\pi\).
\[\prod_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] =
2020!\times \cis\left(\pi\right)\] OK, we got it in the form
\(r\cdot\cis(\alpha)\) as required. \(2020!\), by the way is a very large
number. Vsauce already has a video on \(52!\) which is already very large.
</p>
<br>
<hr>
<br />
<hr />
<center><b>Question 3</b></center>
<hr>
<hr />
Another math puzzle.
<p>
<center>
Express \(\boxed{\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right]}\) in the form \(\boxed{\alpha + \beta i}\)&nbsp;&nbsp;&nbsp;&nbsp;(3 marks, no calculator)
</center><br>
Hold up, haven't we done this already? No. This uses the summation formula. Also we want it in rectangular form - not polar form!<br>
There are two mindsets to evaluate this expression: one which is 'local' and the other 'global'<br>
To be honest, I just skipped this question entirely. It was 3 marks and I was unprepared for this sort of question (I was close to a pattern, but the coefficients were not periodic and threw me off.)<br>
<b>Method one: Local</b><br>
A 'local' approach aims to identify how the function or expression behaves at a small or local level.<br>
Let's define the part within the summation as \(f(x)\)
\[\text{Define: } f(x) = n\cdot\cis\left(\frac{\pi}{2}\right)^n\]
Let's see how the function behaves for a *few* values of \(x\).<br>
We're trying to see how the function within the summation of the original expression behaves at a local level, so we don't test all 2020 terms. The goal is to find a pattern that applies for the remaining terms.
Express
\(\boxed{\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right]}\)
in the form \(\boxed{\alpha + \beta i}\)&nbsp;&nbsp;&nbsp;&nbsp;(3
marks, no calculator)
</center>
<br />
Hold up, haven't we done this already? No. This uses the summation
formula. Also we want it in rectangular form - not polar form!<br />
There are two mindsets to evaluate this expression: one which is 'local'
and the other 'global'<br />
To be honest, I just skipped this question entirely. It was 3 marks and I
was unprepared for this sort of question (I was close to a pattern, but
the coefficients were not periodic and threw me off.)<br />
<b>Method one: Local</b><br />
A 'local' approach aims to identify how the function or expression behaves
at a small or local level.<br />
Let's define the part within the summation as \(f(x)\) \[\text{Define: }
f(x) = n\cdot\cis\left(\frac{\pi}{2}\right)^n\] Let's see how the function
behaves for a *few* values of \(x\).<br />
We're trying to see how the function within the summation of the original
expression behaves at a local level, so we don't test all 2020 terms. The
goal is to find a pattern that applies for the remaining terms.
\begin{align} f(1) &= 1\cdot\cis\left(\frac{\pi}{2}\right)^1 \\ f(2) &=
2\cdot\cis\left(\frac{\pi}{2}\right)^2 \\ f(3) &=
3\cdot\cis\left(\frac{\pi}{2}\right)^3 \\ f(4) &=
4\cdot\cis\left(\frac{\pi}{2}\right)^4 \\ f(5) &=
5\cdot\cis\left(\frac{\pi}{2}\right)^5 \\ f(6) &=
6\cdot\cis\left(\frac{\pi}{2}\right)^6 \\ f(7) &=
7\cdot\cis\left(\frac{\pi}{2}\right)^7 \\ f(8) &=
8\cdot\cis\left(\frac{\pi}{2}\right)^8 \\ \end{align} Let's apply De
Moivre's theorem. \begin{alignat}{2} f(1) &=
1\cdot\cis\left(\frac{\pi}{2}\right) &&= \cis\left(\frac{\pi}{2}\right) \\
f(2) &= 2\cdot\cis\left(\frac{2\pi}{2}\right) &&=
2\cdot\cis\left(\pi\right) \\ f(3) &=
3\cdot\cis\left(\frac{3\pi}{2}\right) &&=
3\cdot\cis\left(\frac{3\pi}{2}\right)\\ f(4) &=
4\cdot\cis\left(\frac{4\pi}{2}\right) &&= 4\cdot\cis\left(2\pi\right) \\
f(5) &= 5\cdot\cis\left(\frac{5\pi}{2}\right) &&=
5\cdot\cis\left(\frac{\pi}{2}\right) \\ f(6) &=
6\cdot\cis\left(\frac{6\pi}{2}\right) &&= 6\cdot\cis\left(\pi\right) \\
f(7) &= 7\cdot\cis\left(\frac{7\pi}{2}\right) &&=
7\cdot\cis\left(\frac{3\pi}{2}\right) \\ f(8) &=
8\cdot\cis\left(\frac{8\pi}{2}\right) &&= 8\cdot\cis\left(2\pi\right) \\
\end{alignat} At this point we seem to be close to a pattern (periodic
nature of \(\cis\)), but it doesn't quite seem like one due to the
coefficients which are not repeating.<br />
If we try summing by the pattern that exists (the \(\cis\)), we may see a
pattern emerge \begin{align} \sum_{n=1}^{4}\left[f(n)\right] &=
f(1)+f(2)+f(3)+f(4) \\ &= i -2 -3i +4 \\ &= 2 - 2i \\
\sum_{n=5}^{8}\left[f(n)\right] &= f(5)+f(6)+f(7)+f(8) \\ &= 5i -6 -7i +8
\\ &= 2 - 2i \end{align} In fact we do see a pattern - this sort of local
behavior applies for the whole 2020 terms.<br />
\begin{align}
f(1) &= 1\cdot\cis\left(\frac{\pi}{2}\right)^1 \\
f(2) &= 2\cdot\cis\left(\frac{\pi}{2}\right)^2 \\
f(3) &= 3\cdot\cis\left(\frac{\pi}{2}\right)^3 \\
f(4) &= 4\cdot\cis\left(\frac{\pi}{2}\right)^4 \\
f(5) &= 5\cdot\cis\left(\frac{\pi}{2}\right)^5 \\
f(6) &= 6\cdot\cis\left(\frac{\pi}{2}\right)^6 \\
f(7) &= 7\cdot\cis\left(\frac{\pi}{2}\right)^7 \\
f(8) &= 8\cdot\cis\left(\frac{\pi}{2}\right)^8 \\
\end{align}
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &=
\sum_{n=1}^{4}\left[f(n)\right] + \sum_{n=5}^{8}\left[f(n)\right] +
[\dots] + \sum_{n=2015}^{2020}\left[f(n)\right] \\ &= (2-2i) + (2-2i) +
[\dots] + (2-2i) \\ &= \frac{2020}{4}\cdot(2-2i) \\ &= 1010 - 1010i
\end{align} Hopefully this explains what I mean by 'local' : a bit of an
odd term but it differentiates this line of thinking from the next one I
will show.<br /><br />
The main downside to this mindset is that you may end up wasting time by
testing to find a pattern. For a 3 mark question, I didn't even consider
using this method (although this was the intended method, from what I can
see)<br />
Compared to the global method it has some benefits. In this case it avoids
the use of a complicated summation formula. More generally, it also
requires smaller calculations as we're not looking at the large behavior -
this can minimize mistakes.
Let's apply De Moivre's theorem.
\begin{alignat}{2}
f(1) &= 1\cdot\cis\left(\frac{\pi}{2}\right) &&= \cis\left(\frac{\pi}{2}\right) \\
f(2) &= 2\cdot\cis\left(\frac{2\pi}{2}\right) &&= 2\cdot\cis\left(\pi\right) \\
f(3) &= 3\cdot\cis\left(\frac{3\pi}{2}\right) &&= 3\cdot\cis\left(\frac{3\pi}{2}\right)\\
f(4) &= 4\cdot\cis\left(\frac{4\pi}{2}\right) &&= 4\cdot\cis\left(2\pi\right) \\
f(5) &= 5\cdot\cis\left(\frac{5\pi}{2}\right) &&= 5\cdot\cis\left(\frac{\pi}{2}\right) \\
f(6) &= 6\cdot\cis\left(\frac{6\pi}{2}\right) &&= 6\cdot\cis\left(\pi\right) \\
f(7) &= 7\cdot\cis\left(\frac{7\pi}{2}\right) &&= 7\cdot\cis\left(\frac{3\pi}{2}\right) \\
f(8) &= 8\cdot\cis\left(\frac{8\pi}{2}\right) &&= 8\cdot\cis\left(2\pi\right) \\
\end{alignat}
At this point we seem to be close to a pattern (periodic nature of \(\cis\)), but it doesn't quite seem like one due to the coefficients which are not repeating.<br>
If we try summing by the pattern that exists (the \(\cis\)), we may see a pattern emerge
\begin{align}
\sum_{n=1}^{4}\left[f(n)\right] &= f(1)+f(2)+f(3)+f(4) \\
&= i -2 -3i +4 \\
&= 2 - 2i \\
\sum_{n=5}^{8}\left[f(n)\right] &= f(5)+f(6)+f(7)+f(8) \\
&= 5i -6 -7i +8 \\
&= 2 - 2i
\end{align}
In fact we do see a pattern - this sort of local behavior applies for the whole 2020 terms.<br>
\begin{align}
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &= \sum_{n=1}^{4}\left[f(n)\right] + \sum_{n=5}^{8}\left[f(n)\right] + [\dots] + \sum_{n=2015}^{2020}\left[f(n)\right] \\
&= (2-2i) + (2-2i) + [\dots] + (2-2i) \\
&= \frac{2020}{4}\cdot(2-2i) \\
&= 1010 - 1010i
\end{align}
Hopefully this explains what I mean by 'local' : a bit of an odd term but it differentiates this line of thinking from the next one I will show.<br><br>
The main downside to this mindset is that you may end up wasting time by testing to find a pattern. For a 3 mark question, I didn't even consider using this method (although this was the intended method, from what I can see)<br>
Compared to the global method it has some benefits. In this case it avoids the use of a complicated summation formula. More generally, it also requires smaller calculations as we're not looking at the large behavior - this can minimize mistakes.
<br>
<b>Method two: Global</b><br>
The 'global' approach observes how the function or expression behaves as a whole.<br>
<br />
<b>Method two: Global</b><br />
The 'global' approach observes how the function or expression behaves as a
whole.<br />
Instantly, let's unpack the summation then, apply De Moivre's theorem.
\begin{align}
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &= \cis\left(\frac{\pi}{2}\right) + 2\cis\left(\frac{\pi}{2}\right)^2 + 3\cis\left(\frac{\pi}{2}\right)^3 + 4\cis\left(\frac{\pi}{2}\right)^4 + 5\cis\left(\frac{\pi}{2}\right)^5 + 6\cis\left(\frac{\pi}{2}\right)^6 + [\dots] + 2020\cis\left(\frac{\pi}{2}\right)^{2020} \\
&= \cis\left(\frac{\pi}{2}\right) + 2\cis\left(\frac{\pi}{2}\cdot 2\right) + 3\cis\left(\frac{\pi}{2}\cdot 3\right) + 4\cis\left(\frac{\pi}{2}\cdot 4\right) + 5\cis\left(\frac{\pi}{2}\cdot 5\right) + 6\cis\left(\frac{\pi}{2}\cdot 6\right) + [\dots] + 2020\cis\left(\frac{\pi}{2}\cdot 2020\right)
\end{align}
What we have here is essentially a series of rotating vectors. So that means we can expect to simplify quite a few of the cis terms, as they repeat periodically.<br>
For example, \(\cis\left(\frac{\pi}{2}\right)=\cis\left(\frac{5\pi}{2}\right)=\cis\left(\frac{9\pi}{2}\right)=[\dots]=\cis\left(\frac{\pi}{2}+k\cdot 2\pi\right)\) for integer \(k\)
\[\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] = \cis\left(\frac{\pi}{2}\right) + 2\cis\left(\pi\right) + 3\cis\left(\frac{3\pi}{2}\right) + 4\cis\left(2\pi\right) + 5\cis\left(\frac{\pi}{2}\right) + 6\cis\left(\pi\right) + [\dots] + 2020\cis\left(2\pi\right)\]
Alright, let's collect the cis terms according to their (simplified) angle.
\[\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] = (1+5+9+13+[\dots])\times\cis\left(\frac{\pi}{2}\right) + (2+6+10+14+[\dots])\times\cis\left(\pi\right) + (3+7+11+15+[\dots])\times\cis\left(\frac{3\pi}{2}\right) + (4+8+16+20+[\dots])\times\cis\left(2\pi\right)\]
We need to use the arithmetic progression sum formula, because we have a common difference \(d\) of 4 between each number, not 1 like last time. Also for our terms, we have different starting values, \(a_0\)
\[\boxed{\sum_{k=1}^{n-1}\left[a_0+k\cdot d\right] = \frac{n}{2}\left[(n-1)\cdot d+2a_0\right]}\]
Now, we have \(\frac{2020}{4}\) terms for each unique angle for \(\cis\) because 2020 is divisible by 4 (The number of \(\cis\) with unique angles) evenly. In other scenarios this may not be the case and \(n\) may vary for each sum.<br>
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &=
\cis\left(\frac{\pi}{2}\right) + 2\cis\left(\frac{\pi}{2}\right)^2 +
3\cis\left(\frac{\pi}{2}\right)^3 + 4\cis\left(\frac{\pi}{2}\right)^4 +
5\cis\left(\frac{\pi}{2}\right)^5 + 6\cis\left(\frac{\pi}{2}\right)^6 +
[\dots] + 2020\cis\left(\frac{\pi}{2}\right)^{2020} \\ &=
\cis\left(\frac{\pi}{2}\right) + 2\cis\left(\frac{\pi}{2}\cdot 2\right) +
3\cis\left(\frac{\pi}{2}\cdot 3\right) + 4\cis\left(\frac{\pi}{2}\cdot
4\right) + 5\cis\left(\frac{\pi}{2}\cdot 5\right) +
6\cis\left(\frac{\pi}{2}\cdot 6\right) + [\dots] +
2020\cis\left(\frac{\pi}{2}\cdot 2020\right) \end{align} What we have here
is essentially a series of rotating vectors. So that means we can expect
to simplify quite a few of the cis terms, as they repeat periodically.<br />
For example,
\(\cis\left(\frac{\pi}{2}\right)=\cis\left(\frac{5\pi}{2}\right)=\cis\left(\frac{9\pi}{2}\right)=[\dots]=\cis\left(\frac{\pi}{2}+k\cdot
2\pi\right)\) for integer \(k\)
\[\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] =
\cis\left(\frac{\pi}{2}\right) + 2\cis\left(\pi\right) +
3\cis\left(\frac{3\pi}{2}\right) + 4\cis\left(2\pi\right) +
5\cis\left(\frac{\pi}{2}\right) + 6\cis\left(\pi\right) + [\dots] +
2020\cis\left(2\pi\right)\] Alright, let's collect the cis terms according
to their (simplified) angle.
\[\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] =
(1+5+9+13+[\dots])\times\cis\left(\frac{\pi}{2}\right) +
(2+6+10+14+[\dots])\times\cis\left(\pi\right) +
(3+7+11+15+[\dots])\times\cis\left(\frac{3\pi}{2}\right) +
(4+8+16+20+[\dots])\times\cis\left(2\pi\right)\] We need to use the
arithmetic progression sum formula, because we have a common difference
\(d\) of 4 between each number, not 1 like last time. Also for our terms,
we have different starting values, \(a_0\)
\[\boxed{\sum_{k=1}^{n-1}\left[a_0+k\cdot d\right] =
\frac{n}{2}\left[(n-1)\cdot d+2a_0\right]}\] Now, we have
\(\frac{2020}{4}\) terms for each unique angle for \(\cis\) because 2020
is divisible by 4 (The number of \(\cis\) with unique angles) evenly. In
other scenarios this may not be the case and \(n\) may vary for each
sum.<br />
Let's apply the series formula to bring these terms together.
\begin{align}
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &= \frac{505}{2}\left[(505-1)\cdot 4+2\cdot1\right]\times\cis\left(\frac{\pi}{2}\right) + \frac{505}{2}\left[(505-1)\cdot 4+2\cdot 2\right]\times\cis\left(\pi\right) + \frac{505}{2}\left[(505-1)\cdot 4+2\cdot 3\right]\times\cis\left(\frac{3\pi}{2}\right) + \frac{505}{2}\left[(505-1)\cdot 4+2\cdot 4\right]\times\cis\left(2\pi\right) \\
&= 509545\times\cis\left(\frac{\pi}{2}\right) + 510050\times\cis\left(\pi\right) + 510555\times\cis\left(\frac{3\pi}{2}\right) + 511060\times\cis\left(2\pi\right) \\
&= 509545\times[0+i] + 510050\times[-1+0i] + 510555\times[0-i] + 511060\times[1+0i] \\
&= 511060 - 510050 + (509545 - 510555)i\\
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &= 1010 - 1010i
\end{align}
And there we have it!<br><br>
The downside to this method is that you end up needing to handle large numbers - which also wastes time and increases chances of making a mistake.<br>
For this particular question, there is also the downside of requiring previous year content (the AP formula), which I certainly did not remember.<br>
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &=
\frac{505}{2}\left[(505-1)\cdot
4+2\cdot1\right]\times\cis\left(\frac{\pi}{2}\right) +
\frac{505}{2}\left[(505-1)\cdot 4+2\cdot
2\right]\times\cis\left(\pi\right) + \frac{505}{2}\left[(505-1)\cdot
4+2\cdot 3\right]\times\cis\left(\frac{3\pi}{2}\right) +
\frac{505}{2}\left[(505-1)\cdot 4+2\cdot
4\right]\times\cis\left(2\pi\right) \\ &=
509545\times\cis\left(\frac{\pi}{2}\right) +
510050\times\cis\left(\pi\right) +
510555\times\cis\left(\frac{3\pi}{2}\right) +
511060\times\cis\left(2\pi\right) \\ &= 509545\times[0+i] +
510050\times[-1+0i] + 510555\times[0-i] + 511060\times[1+0i] \\ &= 511060
- 510050 + (509545 - 510555)i\\
\sum_{n=1}^{2020}\left[n\cdot\cis\left(\frac{\pi}{2}\right)^n\right] &=
1010 - 1010i \end{align} And there we have it!<br /><br />
The downside to this method is that you end up needing to handle large
numbers - which also wastes time and increases chances of making a
mistake.<br />
For this particular question, there is also the downside of requiring
previous year content (the AP formula), which I certainly did not
remember.<br />
<br>
To be completely honest, this question should be worth more than just three marks. In the exam, I decided that this was not worth my time.
<br />
To be completely honest, this question should be worth more than just
three marks. In the exam, I decided that this was not worth my time.
</p>
<a class="link" style="left:1%; bottom: 1%;" href="https://peter-tanner.github.io/maths">🔗 Back to MATHS home page</a><br>
<a class="link" style="left:1%; bottom: 1%;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br>
</body>
<a
class="link"
style="left: 1%; bottom: 1%"
href="https://peter-tanner.github.io/legacy_site/maths"
>🔗 Back to MATHS home page</a
><br />
<a
class="link"
style="left: 1%; bottom: 1%"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br />
</body>
</html>

View File

@ -1,51 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<head>
<meta charset="UTF-8" />
<title>📝 Maths!</title>
<meta name="description" content="year 12 WACE specialist ATAR stuff">
<meta name="viewport" content="width=device-width">
<meta name="description" content="year 12 WACE specialist ATAR stuff" />
<meta name="viewport" content="width=device-width" />
<script>
MathJax = {
tex: { macros: {cis: "\\mathop{\\rm{cis}}\\nolimits"} },
chtml: { displayAlign: 'center', scale: 1.1 }
}
tex: { macros: { cis: "\\mathop{\\rm{cis}}\\nolimits" } },
chtml: { displayAlign: "center", scale: 1.1 },
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
</head>
<script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>
<link rel="stylesheet" href="style.css" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
crossorigin="anonymous"
/>
</head>
<body>
Welcome to my math page.<br>
Random content from my math adventures (Both from WACE and now uni)<br>
<body>
Welcome to my math page.<br />
Random content from my math adventures (Both from WACE and now uni)<br />
<div class="card">
<div class="card-body">
<b>Multivariable calc</b><br>
<del><a href="https://peter-tanner.github.io/maths/1011_potential.html">Scalar potential calculator \(\Psi(x,y,z)=?\)</a> <br></del>
<b>Multivariable calc</b><br />
<del
><a
href="https://peter-tanner.github.io/legacy_site/maths/1011_potential.html"
>Scalar potential calculator \(\Psi(x,y,z)=?\)</a
>
<br
/></del>
Sorry I got lazy and it's not finished...
</div>
</div><br>
</div>
<br />
<div class="card">
<div class="card-body">
<div style="text-align:center">Knowledge from WACE</div>
<b>Year 12</b><br>
<a href="https://peter-tanner.github.io/maths/de moivre theorem.html">Polar form of complex number, De Moivre's theorem</a> <br>
<a href="https://peter-tanner.github.io/maths/cis notation rant.html">A little rant on why \(e^{\pi\theta}\) is superior to \(\cis(\theta)\). All my opinion only ⚠</a> <br>
<a href="https://classpad.github.io/">🔗 Classpad page - Download classpad programs I've made in year 12 for free!</a><br>
<a href="https://atar-wace-archive.github.io/">🔗 ATAR/WACE archive - comprehensive archive of past papers (although, not as useful for math subjects compared to others.)</a><br>
<b>Year 11</b><br>
<a href="https://peter-tanner.github.io/maths/2.5d rotations.html">'2.5d' rotations using matrix transformations ⚠</a>
<br>
<br>
*<b>⚠ Very losely related to the actual content...</b> Probably not useful.
<div style="text-align: center">Knowledge from WACE</div>
<b>Year 12</b><br />
<a
href="https://peter-tanner.github.io/legacy_site/maths/de moivre theorem.html"
>Polar form of complex number, De Moivre's theorem</a
>
<br />
<a
href="https://peter-tanner.github.io/legacy_site/maths/cis notation rant.html"
>A little rant on why \(e^{\pi\theta}\) is superior to
\(\cis(\theta)\). All my opinion only ⚠</a
>
<br />
<a href="https://classpad.github.io/"
>🔗 Classpad page - Download classpad programs I've made in year 12
for free!</a
><br />
<a href="https://atar-wace-archive.github.io/"
>🔗 ATAR/WACE archive - comprehensive archive of past papers
(although, not as useful for math subjects compared to others.)</a
><br />
<b>Year 11</b><br />
<a
href="https://peter-tanner.github.io/legacy_site/maths/2.5d rotations.html"
>'2.5d' rotations using matrix transformations ⚠</a
>
<br />
<br />
*<b>⚠ Very losely related to the actual content...</b> Probably not
useful.
</div>
</div>
<a class="link" style="left:1%; bottom: 1%; position: absolute;" href="https://peter-tanner.github.io">🔗 Back to home page</a><br>
</body>
<a
class="link"
style="left: 1%; bottom: 1%; position: absolute"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br />
</body>
</html>