Start business or get a degree?

Ok, I’m biased in this. I would suggest you start a business. But I would come off as fake, since I do have a university degree.

In these tough economic times, the value of a university (or college) degree is highly debated. Some people say you don’t need a degree (here and here). And there are also articles and studies saying a degree is (still) the best investment you can make (for example, here and here). [For the latter article, I would add that you be careful of the word "average" being thrown around. Because you read my blog, I would suggest that you're more than just average.]

DISCLAIMER: The Singapore education system might be different from the system you have in your country. I can’t even tell you if the Singapore system as of writing now is the same as what I went through.

Should I buy the steel sword now or later?

In the role-playing video games I’ve played when I was younger, I would arrive in a town and I’d be immediately broke. I’d go buy the best armour and weapons money can buy. Inevitably, the game designers made it such that it’s highly unlikely you would have enough money to buy every single piece of best armour and weapons for your character(s).

Now you have a decision to make.

“I don’t have enough money. Should I buy that bronze sword now so I can continue with the adventure? Or just tough it out until I reach the next town, where I can buy the steel sword for just a little bit more money?”

That degree you’re thinking of getting is that adamantium sword. And it’s available for purchase about, oh, 8 towns later. You better tough it out…

A degree is traditionally considered the be-all-end-all. Once you have it, you’re set for life. It’ll open doors for you in the corporate world. People judge you (highly?) based on a piece of paper that you have. Job recruiters screen you based on the type of degree you have, looking for computer science degree graduates even though someone with a bachelor of science (majoring in applied mathematics and computational science) is just as qualified *cough*.

There is always another sword better than whatever you have (even adamantium). It doesn’t happen in games because they’re finite. But in real life, there’s always something better you can have. Maybe a professional certificate in something. Certifications by Microsoft, Oracle or any company/organisation that’s respected.

Don’t waste your freedom

Through my primary school, secondary school and junior college days, I had to wake up early and be at school by 7:30am. School ends sometime in the afternoon, where I might have extra curricular activities.

When I was drafted into the military, I was told when I had to wake up. I was told when and what to do in my waking hours. And I was told when to go to bed.

When I started at a job, I had to be in the office at 8:30am. I could only go for lunch between 12 noon and 2pm, and only for 1 hour. I could only go home after 6pm.

I only had freedom of time when I was in the university (and now, when I’m working for myself). When I was in university, I typically took about 20 credits per semester (about 5 classes), which was about 20+ hours of lectures and tutorial work. The class timings were still fixed, but for the first time in my educational life, I had some degree (no pun intended) of freedom. I could choose which tutorial classes I wanted to attend. I could plan my time each week and even each day.

So if you’re looking for advice, I suggest this: Go to university/college and get your degree if you can (keeping the cost of time and money in mind). But start a business while you’re there.

Don’t give me that cranberry about not having enough time. Even if you stretch it, lectures and tutorials only consume up to 30 hours per week of your time. You still have 10 hours more per week than if you’re working full time! Make use of that.

Don’t drink (alcohol). Don’t do drugs. Don’t party (too much). Don’t smoke.

I get that this period of time might be liberating to you, but it’s also the time where your self-discipline is most tested. I’m not saying you can’t have fun. But if you can’t hold yourself accountable now, your future work at a job is going to suck cannonballs.

You have a huge university debt the moment you start. Don’t wait 4 years before struggling to find a job that pays enough that you can repay that.

If the statistics are true, most small businesses fail within 5 years. You have 4 years in university. Start failing then.

You can either start your own business and have some control over your future. Or you can work at a company where the company controls your future.

If you’re reading this, I assume you’re either a mathematician, a scientist or a programmer. Start a business. Get a degree. You’ll probably do fine either way. Even better, start a business while you’re getting your degree.

Cartesian coordinates and transformation matrices

If you’re doing any work in 3D, you will need to know about the Cartesian coordinate system and transformation matrices. Cartesian coordinates are typically used to represent the world in 3D programming. Transformation matrices are matrices representing operations on 3D points and objects. The typical operations are translation, rotation, scaling.

2 dimensional Cartesian coordinates

You should have seen something like this in your math class:

2D Cartesian coordinates
[original image]

The Roman letters I, II, III, and IV represent the quadrants of the Cartesian plane. For example, III represents the third quadrant. Not a lot to say here, so moving on…

3 dimensional Cartesian coordinates

And for 3 dimensions, we have this:

3D Cartesian coordinates
[original image]

I don’t quite like the way the z-axis points upward. The idea probably stems from having a piece of paper representing the 2D plane formed by the x and y axes. The paper is placed on a flat horizontal table, and the z-axis sticks right up.

Mathematically speaking, there’s no difference.

However, I find it easier to look at it this way:

Another 3D Cartesian representation

The XY Cartesian plane is upright, representing the screen. The z-axis simply protrudes out of the screen. The viewport can cover all four quadrants of the XY plane. The illustration only covered the first quadrant so I don’t poke your eye out with the z-axis *smile*

There is also something called the right-hand rule, and correspondingly the left-hand rule. The right-hand rule has the z-axis pointing out of the screen, as illustrated above. The left-hand rule has the z-axis pointing into the screen. Observe the right-hand rule:

Right-hand rule

The thumb represents the x-axis, the index finger represents the y-axis and the middle finger represents the z-axis. As for the left-hand rule, we have:

Left-hand rule

We’re looking at the other side of the XY plane, but it’s the same thing. The z-axis points in the other direction. And yes, I have long fingers. My hand span can cover an entire octave on a piano.

What’s the big deal? Because your 3D graphics engine might use a certain rule by default, and you must follow. Otherwise, you could be hunting down errors like why an object doesn’t appear on the screen. Because the object was behind the camera when you thought it’s in front. Your selected graphics engine should also allow you to use the other rule if you so choose.

In case you’re wondering, here’s the right-hand rule illustration with the z-axis pointing upwards:

Right-hand rule with z-axis upwards

I still don’t like a skyward-pointing z-axis. It irks me for some reason…

Scaling (or making something larger or smaller)

So how do you enlarge or shrink something in 3D? You apply the scaling matrix. Let’s look at the 2D version:

Scaling a circle in 2D

If your scaling factor is greater than 1, you’re enlarging an object. If your scaling factor is less than 1, you’re shrinking an object. What do you think happens when your scaling factor is 1? Or when your scaling factor is negative?

So how does the scaling factor look like in a scaling matrix?

Scaling matrix 2D

If you don’t know what that means, or don’t know what the result should be like, review the lesson on matrices and the corresponding program code.

You will notice there are separate scaling factors for x- and y- axes. This means you can scale them independently. For example, we have this:

Sphere above water

And we only enlarge along the x-axis:

Enlarge sphere along x-axis

We can also only enlarge along the y-axis:

Enlarge sphere along y-axis

Yeah, I got tired of drawing 2D pictures, so I decided to render some 3D ones. Speaking of which, you should now be able to come up with the 3D version of the scaling matrix. Hint: just add a scaling factor for the z-axis.

Rotating (or spinning till you puke)

This is what a rotation matrix for 2 dimensions looks like:

Rotation matrix 2D

That symbol that looks like an O with a slit in the middle? That’s theta (pronounced th-ay-tuh), a Greek alphabet. It’s commonly used to represent unknown angles.

I’ll spare you the mathematical derivation of the formula. Just use it.

You can convince yourself with a simple experiment. Use the vector (1,0), or unit vector lying on the x-axis. Plug in 90 degrees for theta and you should get (0,1), the unit vector lying on the y-axis.

That’s anti-clockwise rotation. To rotate clockwise, just use the value with a change of sign. So you’ll have -90 degrees.

Depending on the underlying math libraries you use, you might need to use radians instead of degrees (which is typical in most math libraries). I’m sure you’re clever enough to find out the conversion formula for degree-to-radian yourself…

Now for the hard part. The 3D version of rotation is … a little difficult. You see, what you’ve read above actually rotates about the implied z-axis. Wait, that means you can rotate about the x-axis! And the y-axis! Sacrebleu! You can rotate about any arbitrary axis!

I’ll write another article on this. If you’re into this, then you might want to take a look at this article on 3D rotation. I’ll also touch on a concept where you rotate about one axis and then rotate about another axis. Be prepared for lots of sine’s and cosine’s in the formula. Stop weeping; it’s unseemly of you.

Translating (nothing linguistic here)

What it means is you’re moving points and objects from one position to another. Let’s look at a 1 dimensional example:

Translation in 1 dimension

The squiggly unstable looking d-wannabe? It’s the Greek alphabet delta. Delta-x is a standard notation for “change in x”. In this case “x” refers to distance along the x-axis. We’ll use an easier-to-type version called “dx” for our remaining discussion.

Translation in 2 dimensions

In 2 dimensions, we have the corresponding dy, for “change in y”. Note that there’s no stopping you from using negative values for dx or dy. In the illustration above, dx and dy are negative.

You’ll have to imagine the case for 3D because the diagram is likely to be messy. But it’s easy to visualise. You just do the same for z-axis.

So what’s the transformation matrix for translation? First, you need to extend your matrix size and vector size by one dimension. The exact reasons are due to affine transformations and homogeneous coordinates (I’ve mentioned them briefly earlier).

Consider this: You have a point (x,y,z) and you want it to be at the new position (x + dx, y + dy, z + dz). The matrix will then look like this:

Translation matrix

Notice that for scaling, the important entries are the diagonal entries. For rotation, there are sine’s and cosine’s and they’re all over the place. But for translation, the “main body” of the matrix is actually an identity matrix. The fun stuff happens in the alleyway column on the extreme right of the matrix.

That reminds me. Because you’ll be using all the transformation matrices together, all matrices must be of the same size. So scaling and rotation matrices need to be 4 by 4 too. Just extend them with zero entries except the bottom right entry, which is 1.

Conclusion

We talked about 2D and 3D Cartesian coordinates. I’ve also shown you the right-hand and left-hand rules. This forms the basis for learning basic transformations such as scaling, rotation and translation.

There are two other interesting transformation matrices: shearing and reflection. I thought what we have is good enough for now. You are free to do your own research. When the situation arise, I’ll talk about those two transformations.

If you enjoyed this article and found it useful, please share it with your friends. You should also subscribe to get the latest articles (it’s free).

You might find this article on converting between raster, Cartesian and polar coordinates useful.

You might find these books on “coordinate transformation” useful.