avatar tianjara.net | blog icon Andrew Harvey's Blog

Entries tagged "math1231".

MATH1081 and MATH1231 Cheat Sheets
19th March 2009

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.

math1081.pdf math1081.tex

math1231-alg.pdf math1231-alg.tex

math1231-calc.pdf math1231-calc.tex

Tags: math1081, math1231.
Units, Vectors and Bases. Metrics?
2nd October 2008

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.

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 - 2x + x2. Now if we put the coefficients into a vector, (3, -2, 1) then this vector is called the coordinate vector of 3 - 2x + x2 with respect to the ordered basis {1, x, x2}[1]. This sounds clear, but let me propose the following.

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)]S. 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.

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)}.

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.

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.

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 - 2x + x2 is really just the vector (3, -2, 1) with a standard basis of {1, x, x2}. 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?).

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.

References: [1] MATH1231 Algebra [Online]. Angell D. 2005. Accessed July 2008. Ch 6, Pg 70. http://web.maths.unsw.edu.au/~angell/1231alg/

Tags: math1231, mathematics.
(x,y,z,w) in OpenGL/Direct3D (Homogeneous Coordinates)
29th September 2008

I always wondered why 3D points in OpenGL, Direct3D and in general computer graphics were always represented as (x,y,z,w) (i.e. why do we use four dimensions to represent a 3D point, what's the w 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.

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,

$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}.$

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,

$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}$

will rotate the vector (x,y,z) by angle theta about the z axis.

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 w in this blog). Now we can perform the translation,

$latex \mathbb{R}^2 : (x,y) \to (x+a, y+b)$

by a matrix multiplication,

$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}.$

We need this extra dimension for the multiplication to make sense, and it allows us to represent all affine transformations as matrix multiplication.

REFERENCES: Homogeneous coordinates. (2008, September 29). In Wikipedia, The Free Encyclopedia. Retrieved 04:33, September 29, 2008, from http://en.wikipedia.org/w/index.php?title=Homogeneous_coordinates&oldid=241693659

Tags: graphics, math1231, mathematics, projections.

RSS Feed