Andrew Harvey's Blog - Entries tagged math1231Entries tagged math1231
//tianjara.net/blog/
en-auThe content on this blog by Andrew Harvey, unless otherwise noted is licensed under a Creative Commons Attribution 3.0 Australia License.Chronicle/blog/img/blog-icon.pngAndrew Harvey's Blog
//tianjara.net/blog/
MATH1081 and MATH1231 Cheat Sheets
/blog/archive/2009/03/math1081_and_math1231_cheat_sheets.html
/blog/archive/2009/03/math1081_and_math1231_cheat_sheets.htmlThu, 19 Mar 2009 09:44:18 +1100<p>Just cross posting my cheat sheets from MATH1081 and MATH1231. PDF and LaTeX source are provided. These are from 08s2, at UNSW. I've released them into the public domain, if that is not legally possibly in Australia then lobby your parliament representative.</p>
<p><a href="/blog/attachments/2009/03/math1081.pdf">math1081.pdf</a>
<a href="/blog/attachments/2009/03/math1081.tex">math1081.tex</a></p>
<p><a href="/blog/attachments/2009/03/math1231-alg.pdf">math1231-alg.pdf</a>
<a href="/blog/attachments/2009/03/math1231-alg.tex">math1231-alg.tex</a></p>
<p><a href="/blog/attachments/2009/03/math1231-calc.pdf">math1231-calc.pdf</a>
<a href="/blog/attachments/2009/03/math1231-calc.tex">math1231-calc.tex</a></p>
Units, Vectors and Bases. Metrics?
/blog/archive/2008/10/units__vectors_and_bases__metrics_.html
/blog/archive/2008/10/units__vectors_and_bases__metrics_.htmlThu, 2 Oct 2008 09:40:22 +1000<p>I began wondering about this mainly when the idea of a basis is used in linear algebra, although it seems to be strongly related to scalars, just as basis is to vector as one is to scalar.</p>
<p>This area of investigation for me arose when then they took coordinate vectors out of the UNSW MATH1231 (2007) syllabus. So I had to do a bit of reading on my own. To understand coordinate vectors its helpful to look at the vector space of polynomials. For example take the polynomial 3 - 2<span style="font-style:italic;">x</span> + <span style="font-style:italic;">x</span><sup>2</sup>. Now if we put the coefficients into a vector, (3, -2, 1) then this vector is called the coordinate vector of 3 - 2<span style="font-style:italic;">x</span> + <span style="font-style:italic;">x</span><sup>2</sup> with respect to the ordered basis {1, <span style="font-style:italic;">x</span>, <span style="font-style:italic;">x</span><sup>2</sup>}<sup>[1]</sup>. This sounds clear, but let me propose the following.</p>
<p>Say we have the coordinate vector (1,2,3) with respect the the ordered basis S = {(1,0,0), (0,1,0), (0,0,1)}, denoted [(1,2,3)]<sub>S</sub>. How is this different to just (1,2,3)? Aren't all vectors, by convention defined with respect to the standard basis of that vector space? But that cannot possibly make sense because bases are defined in terms of vectors, so that would be a recursive definition which is not logically valid. There must be a more reasonably explanation.</p>
<p>Now looking at this in the vector space of say $latex \mathbb{R}^2$ we can take one basis of B = {(1,0), (0,1)} which is the standard basis, and another C = {(1,1), (-1,1)}.</p>
<p><a href="/blog/attachments/2008/10/coordvectors-wp.png"><img class="aligncenter size-full wp-image-34" title="coordvectors" src="/blog/attachments/2008/10/coordvectors-wp.png" alt="" width="240" height="147" /></a></p>
<p>Now if we define the point (1,2) with respect the the basis C, then with respect to the basis B this is the point, 1(1, 1) + 2(-1, 1) = (-1, 3). So essentially this allows us to still work with respect to the standard basis B, but we can work in the frame of C which allows us to then say treat the point (1,1) as just (1,0) which can simplify things.</p>
<p>Again looking at this graphically say in $latex \mathbb{R}^2$ then we can just draw essentially any two non-parallel lines which we call our axis or basis. Any mathematics that is done in any of these coordinate systems with respect to that coordinate system (i.e. the two lines drawn) would be the same. (1,1) + (2,0) would give (3,1) in both systems. Its only when we start defining one vector in one system with respect to the basis of the other system that we need to worry about the difference between the bases.</p>
<p>In the same sense I would say, mathematically it is meaningless to draw some Euclidean geometry on paper without drawing in your standard basis. Without them everything is meaningless as you define vectors as coordinate vectors with respect to some basis. Just as the polynomial 3 - 2<span style="font-style:italic;">x</span> + <span style="font-style:italic;">x</span><sup>2</sup> is really just the vector (3, -2, 1) with a standard basis of {1, <span style="font-style:italic;">x</span>, <span style="font-style:italic;">x</span><sup>2</sup>}. I guess you would call them metrics of the vector space of $latex \mathbb{R}^2$, just like 1 is the metric of all subsets of the real numbers (is it?).</p>
<p>As a final note I think this is just the same as 2 is really means 2 × 1, and 3 means three lots of 1's. Any links to abstract algebra? Probably, I'm not sure.</p>
<p><span style="font-weight:bold;font-size:85%;">References:</span>
<sup>[1]</sup> MATH1231 Algebra [Online]. Angell D. 2005. Accessed July 2008. Ch 6, Pg 70. <a href="http://web.maths.unsw.edu.au/%7Eangell/1231alg/">http://web.maths.unsw.edu.au/~angell/1231alg/</a></p>
(x,y,z,w) in OpenGL/Direct3D (Homogeneous Coordinates)
/blog/archive/2008/09/_x_y_z_w__in_opengl_direct3d__homogeneous_coordinates_.html
/blog/archive/2008/09/_x_y_z_w__in_opengl_direct3d__homogeneous_coordinates_.htmlMon, 29 Sep 2008 09:33:12 +1000<p>I always wondered why 3D points in OpenGL, Direct3D and in general computer graphics were always represented as (<span style="font-style:italic;">x</span>,<span style="font-style:italic;">y</span>,<span style="font-style:italic;">z</span>,<span style="font-style:italic;">w</span>) (i.e. why do we use four dimensions to represent a 3D point, what's the <span style="font-style:italic;">w</span> for?). This representation of coordinates with the extra dimension is know as homogeneous coordinates. Now after finally getting formally taught linear algebra I know the answer, and its rather simple, but I'll start from the basics.</p>
<p>Points can be represented as vectors, eg. (1,1,1). Now a common thing we want to do in computer graphics is to move this point (translation). So we can do this by simply adding two vectors together,</p>
<p style="text-align:center;">$latex \begin{pmatrix}x'\\y'\\z'\end{pmatrix} = \begin{pmatrix}x\\y\\z\end{pmatrix} + \begin{pmatrix}a\\b\\c\end{pmatrix} = \begin{pmatrix}x + a\\y + b\\z + c\end{pmatrix}.$</p>
<p style="text-align:left;">If we wanted do some kind of linear transformation such as rotate about the origin, scale about the origin, etc, then we could just multiply a certain matrix with the point vector to obtain the image of the vector under that transformation. For example,</p>
<p style="text-align:center;">$latex \begin{pmatrix}x'\\ y'\\ z' \end{pmatrix} = \begin{pmatrix}\cos \theta &-\sin \theta &0\\ \sin \theta &\cos \theta &0\\ 0&0&1\end{pmatrix} \begin{pmatrix}x\\ y\\ z\end{pmatrix}$</p>
<p style="text-align:left;"></p>
<p style="text-align:left;">will rotate the vector (<span style="font-style:italic;">x</span>,<span style="font-style:italic;">y</span>,<span style="font-style:italic;">z</span>) by angle theta about the <span style="font-style:italic;">z</span> axis.</p>
<p>However as you may have seen you cannot do a 3D translation on a 3D point by just multiplying a 3 by 3 matrix by the vector. To fix this problem and allow all affine transformations (linear transformation followed by a translation) to be done by matrix multiplication we introduce an extra dimension to the point (denoted <span style="font-style:italic;">w</span> in this blog). Now we can perform the translation,</p>
<p style="text-align:center;">$latex \mathbb{R}^2 : (x,y) \to (x+a, y+b)$</p>
<p>by a matrix multiplication,</p>
<p style="text-align:center;">$latex \begin{pmatrix}1 & 0 & a\\ 0 & 1 & b\\ 0 & 0 & 1\end{pmatrix} \begin{pmatrix}x\\ y\\ 1\end{pmatrix} = \begin{pmatrix}x + a\\ y + b\\ 1 \end{pmatrix}.$</p>
<p>We need this extra dimension for the multiplication to make sense, and it allows us to represent all affine transformations as matrix multiplication.</p>
<p><span style="font-size:85%;">REFERENCES:
Homogeneous coordinates. (2008, September 29). In <em>Wikipedia, The Free Encyclopedia</em>. Retrieved 04:33, September 29, 2008, from <a class="external free" title="http://en.wikipedia.org/w/index.php?title=Homogeneous_coordinates&oldid=241693659" rel="nofollow" href="http://en.wikipedia.org/w/index.php?title=Homogeneous_coordinates&oldid=241693659">http://en.wikipedia.org/w/index.php?title=Homogeneous_coordinates&oldid=241693659</a></span></p>