Saturday, October 15, 2011

Planes and their Normals

 Firstly, let us consider planes in 3 space. We all have a geometric idea of a what a plane is, but, it is always good to start with a good definition of any mathematical object that one is dealing with.

So, what is a plane? One definition that we can use is:


        Given a vector and a point, a plane is the set of all vectors which are perpendicular in direction to the given vector, and contain the given point.

Now, why would we pick such a weird definition? Well, here's why. We know a lot about perpendicular things, and if they're vectors, we can use the dot product in special ways to our advantage. Basically, if you have Euclidean Geometry, it usually helps to turn it into vectors, because that gives us an edge on the problems posed, because the dot product links Euclidean Geometry to coordinates. And, we have the cross product as well, which would give as a normal vector.



Let's try to use this definition to derive an equation for a plane from a given normal vector and a point.



Say the vector we are given is called $\vec{v}$, and the point is called $A$. Lets give these some more information:

$\vec{v} = <a,b,c>$
$A = (x_0, y_0, z_0)$

Let $\vec{w}$ be the position vector of $A$. And, let us introduce a second point, with a position vector of:

$\vec{m} = <x, y, z>$

The x, y and z are arbitrary and not fixed. We know (from our definition):

$(\vec{m}-\vec{w}) \cdot \vec{v} = 0$

This expands out to:

$a(x-x_0) + b(y-y_0) + c(z-z_0) = 0$


Which is a equation for the plane. Obviously, having the plane defined in terms of a normal (and a point) helped a lot since we we could use existing knowledge of the dot product. Now, lets see again why this is so useful.

Given two vectors, $\vec{v}$ and $\vec{w}$, find the equation of the plane they form.

Lets see, if want the equation of the plane, and we have two vectors, we'll need to get the normal vector from these, which is perpendicular to both $\vec{v}$ and $\vec{w}$... Oh yeah! The cross product! When you take the cross product of two vectors, the vector returned is perpendicular in direction to the argument vectors.

So, lets set some stuff up:

$\vec{v} = <v_x, v_y, v_z>$
$\vec{w} = <w_x, w_y, w_z>$

$\vec{v} \times \vec{w} = <v_yw_z - v_zw_y, v_zw_x - v_xw_z, v_xw_y-v_yw_x>$

This we can plug right into the our plane equation that we derived, and, we're done!

As you can see, defining planes in 3 space in terms of their normal vectors is an excellent idea since we can leverage existing knowledge in the field to vectors to kill problems. Also, vectors allow us to go from Euclidean geometry ($||v|| ||w|| cos \theta$) to algebra ($v_xw_x + v_yw_y + v_zw_z$) very easily.

Normals are used excessively in game development and graphics for areas such as lighting and shadows. In fact, it is used so much, a brilliant computer scientist (John Carmack) came up with the Fast Inverse Square Root  that uses Newton's method in a clever way.

For the people asking for more advanced stuff and less uselessly detailed solutions, I tried doing that this blog post (though it was still a relatively elementary topic), tell me what you think in the comments below :)

Sunday, October 9, 2011

Today's topic: A rather interesting problem

I came across this problem and it seems quite interesting, so, I'll present it to you guys.

Problem Statement:


If that looks really confusing, don't worry about it, we'll go through everything. Firstly, let us consider the left hand side of the equation. The first thing one should notice is that P is a function. You're probably not wondering, "Well, I've seen functions like P(x) before, but, what does P(P(x)) mean?", but, I'm going to tell you anyway, since some of you might be wondering exactly that.

Let me sidetrack for a moment here. Suppose you have a function f(x) = x^2. We know that


And so on. What if, we take the value of f(3) (i.e. 9) and stick back into f?



That can also be written as



Now, read carefully because this is where a lot of people have trouble, but, a smart individual like yourself should be able to figure it out in a snap!

Say, instead of f(3), we stick back in f the value f(x), so we can write that as




What if, we let y = f(x)? Since in the equation f(x) = x^2, x is just a placeholder (we can call it y or n or k or whatever the heck you want), we get:



And, substituting y = f(x), we get:


And, that's how functions inside functions work, this usually known as functional composition, mostly because mathematicians use big names to make themselves look clever (I've also noticed this with doctors) :P.

So, back to the problem at hand. The left hand side is basically taking P(x) (a polynomial) and sticking it into P(x) again. Now, that we have a rudimentary idea of how things are at the left, lets look at the right side of the equation.


That looks a lot less intimidating to me, basically, saying:


Now, this is where we actually get to attack the problem. What if, just like in our discussion of functional composition, we set


And, the equation transforms into:


And, since x and y are just placeholder variables,


So, that's it, we're done! That basically means that all equations that have x and an exponent will have the property mentioned in the problem, examples are:


Note: For those of you that want crazy rigor, you may notice that y is actually a function of x and not a placeholder variable, but, the idea in a solution that doesn't rely on x isn't much different from this.

Basically, the technique we used was very simple, since there were P(x)'s on both sides of the equation, we used a special technique (by setting y=P(x)) to sort of get rid of some of the P(x)'s.

This problem was a small taste of quite large field known as functional equations. If you want to find out some more about this subject, I would suggest this as a starting point, and this after that, and this book, if you're really interested.


If you liked reading this, and know a bit of computer programming, I suggest you head on over to http://poincare101.blogspot.com/, another blog of mine that deals with computer programming, and more advanced (usually pure) mathematics.





Thursday, November 4, 2010

Calculus week!

This week, I'll be posting about specific topics in calculus that I find interesting (or you find interesting; email me, or comment here with a suggestion) or useful. I'm thinking about the first post being about delta-epsilon proofs.

This weeks stub!

So this is the first stub post from e^z maths, in case you didn't read the last entry, just comment on this one with your questions/problems, and I'll reply to them within 1-2 days, if you want them quicker, just email them to me (email's on the right side bar, or on the last post).

Tuesday, November 2, 2010

e^z maths!

Hello!

Mathematics, for most people, is a terrible ordeal you have to get through, and once you're done, you never use it again, and try your best not to remind yourself about it. However, I love math. The sheer joy you get when you solve a difficult problem after many hours of work is incomparable to anything else (maybe jumping off a cliff, but I personally don't think the side effects are worth it :P). I want other people to realize the power and beauty of math as well, so I have created e^z math.

Every week, I'll post a stub of a post that you readers can comment to with your problems in math, and I'll respond to them, within a day (if you mark it as urgent, I'll do it ASAP). You can also send me problems by email at dhaivatpandya AT gmail DOT com (replace the AT and DOT with the respective symbols). You guys can post problems Pre-Algebra, Algebra 1, Algebra 2, Geometry, Precalculus and Calculus/AP Calculus. I will also post some interesting problems that I see during the week as separate posts, I'll also take requests for problems to be solved publicly.

Let's begin e^z math!