Skip to main content

Multimedia maths (2nd edition)

Page 1

Chapter 1 · Arithmetic Refresher


14

M U LT I M E D I A M AT H S

As this chapter offers all necessary mathematical skills for a full mastering of all further topics explained in this book, we strongly recommend it. To serve its purpose, the successive paragraphs below refresh some required aspects of mathematical language as used on the applied level.

1.1 Algebra Real Numbers We typeset the set of: natural numbers (unsigned integers) as N including zero, integer numbers as Z including zero, rational numbers as Q including zero, real numbers (floats) as R including zero. All the above make a chain of subsets: N ⊂ Z ⊂ Q ⊂ R. To avoid possible confusion, we outline a brief glossary of mathematical terms. We recall that using the correct mathematical terms reflects a correct mathematical thinking. Putting down ideas in the correct words is of major importance for a profound insight. Sets We recall writing all subsets in between braces, e.g. the empty set appears as {}. We define a singleton as any subset containing only one element, e.g. {5} ⊂ N, as a subset of natural numbers. We define a pair as any subset containing just two elements, e.g. {115, −4} ⊂ Z, as a subset of integers. In programming the boolean values true and false make up a pair {true, f alse} called the boolean set which we typeset as B. We define Z− = {. . . , −3, −2, −1} whenever we need negative integers only. We express symbolically that −1234 is an element of Z− by typesetting −1234 ∈ Z− .

We typeset the setminus operator to delete elements from a set by using a backslash, e.g. N \ {0} reading all natural numbers except zero, Q \ Z meaning all pure rational numbers after all integer values left out and R \ {0, 1} expressing all real numbers apart from zero and one.


TRIGONOMETRY

59

3.8 Inverse trigonometric functions When an angle α returns sin α = 12 then we may conclude, apart from the obvious α = π6 , for infinitely more angular sizes α to return sin α = 12 . This is due to the periodicity of the function sine and the sine values (except for −1 and 1) to appear twice within one period. We have sin α = 12 if α = π6 but also if α = 5π 6 and we may add multiples of 2π to each of them (due to the periodicity of the plane angle α). We avoid that an infinite number of angles α are the solution to sin α = 12 when we restrict the angle α to the radian interval π [ −π 2 , 2 ]. A similar issue also applies for the cosine and for the tangent, solved in a similar way. We agree on the restricted interval [0, π] for cosine and on the restricted interval π ] −π 2 , 2 [ for tangent. For any x being the result of a sine, cosine or tangent, we find one unique angle α in their restricted interval giving sin α = x, cos α = x or tan α = x respectively. The corresponding functions to trace this unique angle α are called the arcsine, the arccosine and the arctangent. We can typeset the arcsine either as arcsin, asin or sin−1 .

Figure 3.14: The arcsine Arcsine returns for a given sine value its corresponding circular arc √(in radians restricted √ to quadrants I and IV). For instance arcsin 22 = π4 because sin π4 = 22 . α = arcsin x ⇔ x = sin α with

π −π α 2 2

Similarly, arccosine returns for any given cosine value its corresponding circular arc (in radians restricted to quadrants I and II).


60

M U LT I M E D I A M AT H S

α = arccos x ⇔ x = cos α with 0 α π

Finally, arctangent returns for a given tangent value its corresponding circular arc (in

Figure 3.15: The arccosine radians restricted to quadrants I and IV). α = arctan x ⇔ x = tan α with

π −π <α < 2 2

Figure 3.16: The arctangent Example: What is the (smallest) angle made by the straight line through the points size √ 3 1 O(0, 0) and P 2 , 2 and the x-axis? √

Drawing the lines shows an opposite side of length 23 and an adjacent side of length 1 the size of angle α made by the line OP and the x-axis 2 . This allows us to calculate √ 3 √ via the tangent: tan α = 21 = 3. We need to restrict the size of angle α to the radian 2

π interval ] −π [ for the arctangent to return the corresponding size of the targeted angle 2 , 2√ as α = arctan 3 = π3 .


THE GOLDEN SECTION

95

5.5 Exercises Exercise 39 Given the construction C

S

A

T

B

t

D

featuring |AC| = 12 · |AB| and the circular arc tˆ by the circle C(C, |BC|) intersecting the straight line CA at the side of A in point D. Next to this we have a second circular arc Tˆ by the circle C(A, |AD|). Prove that the point S intersects the segment [AB] according to the golden section. In other words, setting length |AB| = 1 should imply length |AS| = Φ1 ≈ 0.618. Hint: write the length of [AD] in terms of the length of [AB] and then calculate their ratio |AS| |AB| . Exercise 40 Given the construction T

A

U

M

B

S

featuring the circular arc by the circle C(M, |MT |), the square ABUT , a midpoint causing |AM| = |MB| and S the intersection point of the circular arc C(M, |MT |) and the straight line AB. Prove that the point B intersects the segment [AS] according to the golden section. In other words, setting length |AB| = 1 should imply length |AS| = Φ ≈ 1.618. Hint: write all lengths |MU|, |MS|, |AS|, |AB| in terms of the length of [AM] and then |AS| calculate the ratio |AB| .


96

M U LT I M E D I A M AT H S

√

Exercise 41 Prove Φ2 + Φ12 = 3 by substituting Φ = 1+2 5 . √

1 Exercise 42 Prove Φ = Φ − 1 by substituting Φ = 1+2 5 . 1 Exercise 43 Prove Φ + Φ =

√

5 by substituting Φ =

√ 1+ 5 2 .

Exercise 44 Prove by substituting, that x1 = −1, x2 = −Φ and x3 = −Φ are the solutions

to the cubic equation x3 + 2 · x2 − 1 = 0.

Exercise 45 The sequence 1, Φ, Φ2 , Φ3 , Φ4 , Φ5 , . . . is a Lucas sequence. Transform this

Lucas sequence (up to 6 elements) to a number sequence linear in Φ (such as 1, Φ, Φ + 1, . . .) by means of the quadratic equation defined by the golden number (5.2).

Exercise 46 In Fibonacci’s footsteps anno 1202, we go for a make-over of the solving of

his famous rabbit population problem. How many couples of rabbits do we breed in one year, given the following conditions? Every rabbit couple is pubescent at the age of two months. Every rabbit couple that is pubescent produces monthly one new rabbit couple. No rabbit dies. We hereby ignore their incest problem and their offsprings being constantly one male plus one female. Start in month 0 using one fresh rabbit couple. Exercise 47 The silver number is the irrational number

√ δ = 1 + 2 ≈ 2.41421 according to its original definition (128 Anno Domini, Ostiahuis). 1) Find a ruler-and-compass construction based upon the Pythagorean Theorem to construct the silver section. 2) We define the silver rectangle in words: ‘it is the rectangle which after cutting away two squares, is similar to the remaining rectangle’. Find the meaningful solution δ to the quadratic equation corresponding to the above definition in words. 3) We define the indexed elements pn ∈ N as a number sequence of John Pell (1611pn converge to the limit δ = 2.41421 . . . 1685) by pn+1 = 2pn + pn−1 . Their ratios pn−1 for incrementing indices n. Prove this.


VECTORS

117

Figure 6.7: The right-hand grip rule or corkscrew-rule directing the cross product    1 5 Example: Given a =  −6  ∈ R3 and b =  2  ∈ R3 . 3 0 

 −6 · 3 − 0 · 2 a × b =  −5 · 3 + 0 · 1  5 · 2 − (−6) · 1 

 −18 =  −15  ∈ R3 16 We verify the cross product a × b to be perpendicular to the vector a by ( a × b) · a = −18 · 5 + (−15) · (−6) + 16 · 0 = 0. Similarly we confirm the cross product a × b to be orthogonal to the vector b. Properties: Given a, b ∈ R3 and λ ∈ R. independency of a scalar

anticommutative property any vector crossed to itself

λ a × b = λ ( a × b)

a × b = −( b × a)     0 a2 a3 − a2 a3 a × a =  −a1 a3 + a1 a3  =  0  = o 0 a1 a2 − a1 a2


118

M U LT I M E D I A M AT H S

Base vectors:

     1 0 0 We cross product the 3D base vectors e 1 =  0 , e 2 =  1  and e 3 =  0 , 0 0 1

to discover how they relate:

e 1 × e 1 = e 2 × e 2 = e 3 × e 3 = o The threesome default 3D base vectors cyclically create the right-handed cartesian frame: e 1 × e 2 = e 3 ,

e 2 × e 3 = e 1 , e 3 × e 1 = e 2 . Alternatively, a left-handed version of it would be defined similarly via: e 1 × e 2 = − e3 , e 2 × e 3 = − e1 , e2 . e 3 × e 1 = −

G e o m e t r i c i n t e r p r e tat i o n Applying the component wise definition of the cross product (see formula (6.12)), we obtain for any two different non-zero location vectors a and b decomposed within their own cartesian plane (see formula (6.7) applied on figure 6.5) as     a cos α b cos(α + θ )   a =  a sin α  and b =  b sin(α + θ )  , 0 0

their returned vector as

 a2 b3 − b2 a3 a × b =  −a1 b3 + b1 a3  a1 b2 − b1 a2


Chapter 8 ¡ Matrices


140

M U LT I M E D I A M AT H S

We often make use of ‘rectangles’ of numbers, for instance when we declare nested arrays during (game) programming (see page 99). Such configurations of numbers or symbols are called matrices. Matrices are extremely useful as they are capable from just holding data, over moving screen pixels to describing Bézier curves. For this reason we study them here in detail, in order to apply matrices optimally in our final chapters.

8.1 The concept of a matrix The concept of a matrix was introduced by the British mathematician James Joseph Sylvester (1814–1897) in all its straightforward simplicity. A matrix is a rectangle of numbers   a11 a12 ··· a1n  a21 a22 ··· a2n    A= . . . ..  , . . .  . . . .  am1

am2

amn

···

of which ai j are called its matrix elements. We typeset a matrix using an uppercase latin character and its indexed elements by the same lowercase character. Horizontally we count m matrix rows and vertically n matrix columns. This way we find element ai j residing in the ith row and jth column. jth column 

.. .  A= . . . a ij  .. .

 th ...   i row

In other words, the first index i denotes the row of the element ai j and the second index j denotes its column. We typeset a matrix of m rows and n columns as Am×n or for instance A ∈ Rm×n in case its elements are real numbers. We call a matrix of this size an ‘m by n’ matrix. If the number of rows is 1, in other words for m = 1, we have a row matrix or row vector. B = 1 0 1 1 1 0 1 0 0 is a 1 × 9 row vector.

If the number of columns is 1, in other words for n = 1, we have a column matrix or column vector.   x  C= y  is a 3 × 1 column vector. z


L I N E A R T R A N S F O R M AT I O N S

175

Figure 9.7: Standard 3D rotation planes

A second possible 3D rotation is the one around the x-axis, which we typeset as Rx,θ and commonly denote as pitch. Rotating around the x-axis does not affect the x-labels, so the first row and column of its operator matrix conserve the x-values. Consequently we deduct the three-dimensional rotation angle θ as    1 0 0 0 x  y   0 cos θ − sin θ 0     z  =  0 sin θ cos θ 0 1 0 0 0 1

Rx,θ around the x-axis over the  

 x   y  ·    z . 1

(9.11)

As a third and final type of 3D rotation we commonly call yaw the rotation around the yaxis, typeset as Ry,θ . Rotating around the y-axis does not affect the y-labels, so the second row and column of its operator matrix conserve the y-values. Consequently we express the three-dimensional rotation Ry,θ around the y-axis over the angle θ as 

  x cos θ  y   0     z  =  − sin θ 1 0

0 1 0 0

sin θ 0 cos θ 0

  0 x  y 0  · 0   z 1 1

   

(9.12)

We warn for a technical detail: the minus sign in Ry,θ resides at its lower left element. All three types of 3D rotation are standard transformations since they each take a cartesian


176

M U LT I M E D I A M AT H S

axis to rotate around. In a future paragraph, we will discuss how to rotate around an arbitrary center and how to combine standard 3D rotations to rotate simultaneously around the x-, y- and z-axis. Example: Standard 3D rotation around the y-axis. We construct the matrix operator to rotate 3D objects around the y-axis over a straight angle, in order to rotate the triangle with vertices A(4, 0, 1), B(0, 3, 2) and C(−1, 2, −1).       x cos π 0 sin π 0 x  y     0 1 0 0       y   z  =  − sin π 0 cos π 0  ·  z  1

0

0

−1 0 0  0 1 0 =  0 0 −1 0 0 0

0

1

1

  0 x   0   y · 0   z 1 1

   

Evaluating its vertices A, B and C returns the rotated triangle as A (−4, 0, −1), B (0, 3, −2) and C (1, 2, 1).

9.4 Reflection Also reflections can be described using matrices. Two-dimensionally we reflect over the x-axis, over the y-axis or over the origin O. We can describe alternatively the reflection over the origin as the standard rotation over the straight angle, or as the combined reflection over the x-axis and the y-axis simultaneously.

ref lection ov er the x - ax is

ref lection ov er the y - ax is


200

M U LT I M E D I A M AT H S

      1 0 0 b0123 (t) = (1 − t)3  0  + 3(1 − t)2t  1  + 3(1 − t)t 2  0  + t 3  0 1 0  3 3  x(t) = (1 − t) + t = y(t) = 3(1 − t)2t + t 3  z(t) = 3(1 − t)t 2 + t 3  2  x(t) = 1 − 3t + 3t 2 = y(t) = 3t − 6t + 4t 3  z(t) = 3t 2 − 2t 3

 1 1  1

(10.4)

y

2

1

-2

P

2

z

-1

0 2

P

1

0

0

-1

-2

P

0

2

x

3

-1

P

1

-2

Figure 10.4: Cubic Bezier segment in 3D

Bezier segments of higher degree We can extend the above routine to generally plot (n + 1)-point Bezier segments running from P0 to Pn and curved by intermediate control points P1 , P2 , P3 , . . ., Pn−1 by applying Pierre Bézier’s method. Skipping its details, we note that the resulting polynomial will keep satisfying Pascal’s Triangle (see page 24): b01234 (t) = 1(1 − t)4 p0 + 4(1 − t)3t p1 + 6(1 − t)2t 2 p2 + 4(1 − t)t 3 p3 + 1t 4 p4 .


BEZIER CURVES

201

10.2 De Casteljau algorithm Simultaneously to Pierre Bézier at Renault, Paul de Casteljau developed in 1959 at Citroën his own construction algorithm for Bezier segments. We outline de Casteljau construction for a cubic Bezier segment defined by the four control points P0 , P1 , P2 and P3 . Construction: We plot the Bezier segment from its initial point P0 to its terminal point P3 , curved by its control points P1 and P2 . Both the points P0 and P3 lie by design on the Bezier segment. 1) We construct six midpoints (see page 47) like this: A as the midpoint of the line segment [P0 P1 ], B as the midpoint of the line segment [P2 P3 ], C as the midpoint of the line segment [P1 P2 ], A as the midpoint of the line segment [AC], B as the midpoint of the line segment [BC], C as the midpoint of the line segment [A B ]. 1 2) This first step corresponds to Pierre Bézier’s plot method for parameter value t = 2 . 1 Its final midpoint C equals the point B0123 2 and is it the only midpoint lying on the Bezier segment. Meanwhile the original set of control points P0 , P1 , P2 , P3 splits into two new sets P0 , A, A ,C and C , B , B, P3 . For each of them we repeat the first step:

plot the Bezier segment from the initial point P0 to the terminal point C , curved by the control points A and A , plot the Bezier segment from the initial point C to the terminal point P3 , curved by the control points B and B. The above outlined de Casteljau construction is clearly recursive (see page 108). 3) Iterate the above steps until the distance between the initial and the terminal control points becomes smaller than a fixed minimum ε > 0, and then connect them both by a line segment.


BEZIER CURVES

213

s0123 (t) =

=

        1 −1 1 0 1  1 1 1 + 4 0  t +  −2  t 2 +  4  t 3 6 2 2 6 1 1 1 −2

 x(t) = 16 − 12 t + 12 t 2     y(t) = 23 − t 2 + 23 t 3     z(t) = 16 + 12 t + 12 t 2 − 13 t 3 y

2

P

1

�2

�1

0

P

1

�1

�2

3

z

1

2

0 2

0

1

P

2

P

x

0

�1

�2

Figure 10.13: Cubic B-spline in 3D space We note that our exemplary B-spline s0123 (t) differs from the ordinary Bezier segment (10.4) defined by the same control points as headed by their location vectors         1 0 0 1 p0 =  0 , p1 =  1 , p2 =  0  and p3 =  1 . 0 0 1 1 D e B o o r’ s a l g o r i t h m The German-American mathematician Carl de Boor (1937) generalized the popular de Casteljau construction to his de Boor construction as the numerically stable alternative to draw or to split B-splines. We skip a complete outline of the de Boor construction, for which we refer to the expert literature. B-splines and B-spline surfaces still reign our contemporary computer aided design (see figures 10.14 and 10.15), ending this chapter where it historically started.


214

M U LT I M E D I A M AT H S

Figure 10.14: CAD using linear, quadratic and cubic B-spline surfaces

Figure 10.15: CAD applying linear and cubic B-splines orthogonally


230

reflex angle, 46 right angle, 46 right triangle, 46 right-hand grip rule, 100, 116 right-handed frame, 100 root, 26, 64 rotation, 172, 183, 191 round, 218 row, 146, 148 row matrix, 140 row operation, 152 row vector, 140 Rule Of Three, 45 scalar, 98 scalar multiplication, 105, 145 scalene triangle, 46 scaling, 169, 185 scientific notation, 217 second order continuity, 203 semi-major axis, 88 semi-minor axis, 88 sense, 101 setminus, 14 shear strain, 178, 179 shearing, 178 side bisector, 46 sign, 217 significand, 217 significant digits, 217 silver number, 96 silver rectangle, 96 silver section, 96 similarity, 47 sine, 50, 52, 71 singleton, 14 singular, 152 skew, 131 slope, 65

M U LT I M E D I A M AT H S

smooth, 202, 203 solution set, 33 spanning set, 110 square matrix, 141 square system, 33 standard transformation, 170 straight angle, 46 subtraction, 15 symmetric matrix, 146 tail, 102 tangent, 50 tangential continuity, 203 trajectory, 108 translation, 164, 165 transpose of a matrix, 146 tree form, 18 triangular system, 33 trinomial, 22 trough, 72 underdetermined, 33 unit circle, 51 unit normal vector, 121 unit vector, 102 unity interval, 196 vector, 98, 101 vector components, 99 vector equation, 127, 133 vector fonts, 205 vertex of a parabola, 68 zero, 218 zero angle, 46 zero divisor, 149, 150 zero matrix, 141, 144, 150 zero vector, 99, 106 zeroth order continuity, 202


Turn static files into dynamic content formats.

Create a flipbook
Multimedia maths (2nd edition) by ACC Art Books - Issuu