Polynomials

2nd Order Polynomials

summary: 

A second order polynomial may have as many as two events appear in an animation at one moment in time.

description: 

The input in yellow goes directly through the origin. The polynomial in red never makes it to positive time. Near the origin, a second red dot appears to run at the other for an annihilation, which should become a familiar sight. Because the coefficients are reals, and the input goes through the origin, the polynomial is in exactly the same line as the input. There is nothing to "knock it" into another place in space.

command: 
q_graph -out poly_2_origin -dir poly -box 6 -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 2 -c 1 -n 1 -c 3 -n 0 -c -2' -color red -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000' -color yellow
math
equation: 

As q goes from (-3, -3, -,3 -3) to (2, 2, 2, 2):
q^3 + 3 q - 2

tags
Math Tag: 
polynomials
Programming Tag: 
command line quaternions
q_add
q_poly

3rd Order Polynomials

summary: 

A third order polynomial can have three events appearing in an animation at once (this is not required, but represents a maximum).

description: 

The input which travels through the origin is shown in yellow. A cubic polynomial is in red. The polynomial continues its march down and to the left after a brief moment of indecision. The coefficients are all real, so the red and yellow are all in the same line.

command: 
q_graph -out poly_3_origin -dir poly -box 5 -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 3 -c 1 -n 1 -c 3 -n 0 -c -2' -color red -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000' -color yellow
math
equation: 

Input: q ranges from (-3, -3, -,3 -,3) to (2, 2, 2, 2)
Output: q^3 + 3 q -2

tags
Math Tag: 
polynomials
Programming Tag: 
command line quaternions
q_add
q_poly

5th Order Polynomials

summary: 

A fifth order polynomial can change its directions as this one does three times.

description: 

The input is in yellow and goes through the origin. The polynomial in red has real coefficients. Perhaps a different polynomial could switch directions 5 times, although I have yet to construct one.

command: 
q_graph -out poly_5_origin -dir poly -box 5 -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 5 -c 1 -n 1 -c 3 -n 0 -c -2' -color red -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000' -color yellow
math
equation: 

Input: (-3, -3, -3, -3) to (2, 2, 2, 2)
Output: q^5 + 3 q - 2

tags
Math Tag: 
polynomial
Programming Tag: 
command line quaternions
q_add
q_poly

2nd Order Polynomials With Quaternion Coefficients

summary: 

A polynomial can be shifted the input line with quaternion coefficients. This is an example of a subtle shift, but it would be trivial to make much more radical changes to the polynomial.

description: 

The yellow line is the input, the red line a 2nd order polynomial with real coefficients, and the green line is the same polynomial with quaternion coefficients. The coefficients are only subtly different as shown in the animation. The green line is never quite in line with the yellow/red line.

command: 
q_graph -out poly_2_q_coeffients -dir poly -box 6 -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 2 -c "1 0.1 0 0" -n 1 -c "3 0 .2 0" -n 0 -c "-2 .01 .01 .01"' -color green -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 2 -c 1 -n 1 -c 3 -n 0 -c -2' -color red -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000' -color yellow
math
equation: 

Input: (-3, -3, -3, -3) to (2, 2, 2, 2)
Ouput: (1, 0.1, 0, 0) q^2 + (3, 0, .2, 0) q - (-2, .01, .01, .01)

tags
Math Tag: 
polynomials
Programming Tag: 
command line quaternions
q_add
q_poly

3rd Order Polynomials with Quaternion Coefficients

summary: 

The green line takes a slightly bigger step away from its real coefficient counterpart. Polynomials can be curved in space due to their quaternion coefficients.

description: 

The input in yellow passes through the origin. The red input has real coefficients, and stays exactly in line with the yellow. The green line with its complex coefficients curves though space, but has the same large scale features as the red line - a reverse s shape.

command: 
q_graph -out poly_3_q_coeffients -dir poly -box 5 -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 3 -c "1 0.1 0 0" -n 1 -c "3 0 .2 0" -n 0 -c "-2 .01 .01 .01"' -color green -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 3 -c 1 -n 1 -c 3 -n 0 -c -2' -color red -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000' -color yellow
math
equation: 

Input: (-3, -3, -3, -3) to (2, 2, 2, 2)
Output in red: q^3 + 3 q - 2
Output in green: (1, .1, 0, 0) q^3 + (3, 0, .2, 0) q - (2, .1, .1, .1)

tags
Math Tag: 
polynomials
Programming Tag: 
command line quaternions
q_add
q_poly

3rd Order Polynomial Not Through the Origin

summary: 

When the input does not go straight through the origin, the behavior of the polynomial becomes hard to guess in both the animations and complex planes.

description: 

The yellow line is the input that goes through the origin for red, a cubic polynomial with real coefficients. The blue line is an input that does not go through the origin, making the curved orange line. That curve appears to line in a plane defined by the yellow and blue lines. The shape of the orange line is distinct from that of the red line. What goes in can dramatically change what comes out. The sharp bend in the t-x graph for the orange line was unexpected.

command: 
q_graph -out poly_3_off_diagonal -dir poly -box 5 -command 'q_add_n -3 -3 -3 -3 .006 .005 .004 .003 1000 | q_poly -n 3 -c 1 -n 1 -c 3 -n 0 -c -2' -color orange -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000 | q_poly -n 3 -c 1 -n 1 -c 3 -n 0 -c -2' -color red -command 'q_add_n -3 -3 -3 -3 .005 .005 .005 .005 1000' -color yellow
math
equation: 

Input for red: (-3, -3, -3, -3) to (2, 2, 2, 2)
Input for orange: (-3, -3, -3, -3) to (3, 2, 1, 0)
Output for red and orange: q^3 + 3 q - 2

tags
Math Tag: 
polynomials
Programming Tag: 
command line quaternions