Showing posts with label coefficient. Show all posts
Showing posts with label coefficient. Show all posts

Tuesday, 28 October 2008

Notation, notation, notation

Upon re-reading my last post, it occurred to me that the notation chosen was likely to be confusing.

To illustrate, we will take the 4 equations previously stated, and line up all of the terms:
Constanty = a
Lineary = ax + b
Quadraticy = ax2 + bx + c
Cubicy = ax3 + bx2 + cx + d
It will be noted that the name of equivalent coefficients changes in each equation.

If we were to use a generic form for the equation, then this name changing goes away:
y = anxn + an-1xn-1 + ... + a3x3 + a2x2 + a1x + a0
Whilst this looks more complex, if we just concentrate on equations of the cubic order and lower, we get:
y = a3x3 + a2x2 + a1x + a0
If a3 is 0, then we get a quadratic equation, and so on:
y = a2x2 + a1x + a0
I think this is potentially less confusing than having the coefficient names change with each order of equation. It also provides for a cleaner and clearer mapping between the underlying mathematics and Java arrays, if we were to chose that mechanism to store the coefficients.

Monday, 27 October 2008

Initial thoughts

Most of the chunks that touch on mathematical subjects are going to be challenging to write. Our task is to write a book that demonstrates how the various facilities in the Processing language can be used to create pictures. Out task is not to teach mathematics. That said, it is difficult to use the various facilities effectively if one does not have some basic knowledge as to the underlying theory. Getting this balance right is potentially one of the biggest challenges we will face.

Obviously I need to start with what a polynomial is, and what they look like, in terms of their generic form. I'd like to use the old joke that a polynomial is a hungry parrot, but I suspect that's a bit too Pythonesque for most people!

Being restricted to quadratic and cubic equations simplifies the task slightly. I can see these equations being a little scary to some:
  • y = ax2 + bx + c (quadratic)
  • y = ax3 + bx2 + cx + d (cubic)
I will probably start off with constants and straight lines, and build up from there:
  • y = a (constant)
  • y = ax + b (linear)
Apart from showing the effects of altering the various coefficients (a, b, c and d), and a very brief explanation of power notation, I can see little to be gained by going into the maths any further.

I would like, where ever possible, to highlight real world examples of these curves. For example, the parabola, as described by a quadratic equation, is formed as the result of a conic section, and is also used for reflectors with a focal-point, such as satellite dishes and light reflectors.

Whilst waiting for my book to arrive, I will do some background reading.