GoPiGo 小汽車︰格點圖像算術《投影幾何》【五‧線性代數】《導引七‧變換組合 VI‧III 》

假設讀者已經知道『複數

Complex number

A complex number is a number that can be expressed in the form a + bi, where a and b are real numbers, and i is the imaginary unit (which satisfies the equation i2 = −1).[1] In this expression, a is called the real part of the complex number, and b is called the imaginary part. If  {\displaystyle z=a+bi}, then we write {\displaystyle \operatorname {Re} (z)=a,} and  {\displaystyle \operatorname {Im} (z)=b.}

Complex numbers extend the concept of the one-dimensional number line to the two-dimensional complex plane by using the horizontal axis for the real part and the vertical axis for the imaginary part. The complex number a + bi can be identified with the point (a, b) in the complex plane. A complex number whose real part is zero is said to be purely imaginary, whereas a complex number whose imaginary part is zero is a real number. In this way, the complex numbers are a field extension of the ordinary real numbers, in order to solve problems that cannot be solved with real numbers alone.

As well as their use within mathematics, complex numbers have practical applications in many fields, including physics, chemistry, biology, economics, electrical engineering, and statistics. The Italian mathematician Gerolamo Cardano is the first person known to have introduced complex numbers. He called them “fictitious” during his attempts to find solutions to cubic equations in the 16th century.[2]

A complex number can be visually represented as a pair of numbers (a, b) forming a vector on a diagram called an Argand diagram, representing the complex plane. “Re” is the real axis, “Im” is the imaginary axis, and i is the imaginary unit which satisfies i2 = −1.

 

是什麼?熟悉它的

運算

通過形式上應用代數結合律交換律分配律,再加上等式i ² = −1,定義複數的加法、減法、乘法和除法:

法則。此處只是簡介如何利用『複數平面』以及『複數運算』表達『平面幾何』的概念。接續文本中祇借 z 起頭的符號 z, z^{'}, z_{\Box}, z^{'}_{\Box}, \cdots 代表『複數』,其餘符號除非特別指定外,都是『實數』也。

這個『複數』 z 有兩種表示法

『笛卡爾座標系形式』 z = x + y*i ,方便表達

【複數加法‧平移】

z + z_t = ( x+y*i ) + ( x_t + y_t * i )

= (x + x_t) + (y+y_t)*i

『極座標形式』 z = r \cdot e^{i \cdot \theta} ,容易展現

【複數乘法‧旋轉】

e^{i \cdot \phi} \cdot r \cdot e^{i \cdot \theta} = r \cdot e^{i \cdot (\phi + \theta)}

若能深入了解

【共軛複數】 z^{*} \ {\equiv}_{df} \ x - y*i = r \cdot e^{- i \cdot \theta}

,將可用它表達許多概念哩!

‧【實部】 re(z) = x = \frac{z + z*}{2}

‧【虛部】 im(z) = y = \frac{z - z*}{2}

‧【長度】 Abs(z) = |z| = \sqrt{x^2+y^2} = \sqrt{z \cdot z^{*}}

‧……

舉例說 z_a \ {\equiv}_{rp} \ \vec{a}, z_b \ {\equiv}_{rp} \ \vec{b} ,那麼

z_a \cdot {z_b}^{*} = \left( r_a \cdot e^{i \cdot {\theta}_a} \right) \left( r_b \cdot e^{- i \cdot {\theta}_b} \right) = r_a \cdot r_b \cdot e^{i({\theta}_a - {\theta}_b)}

= r_a \cdot r_b \cdot \cos({\theta}_a - {\theta}_b) + r_a \cdot r_b \cdot \sin({\theta}_a - {\theta}_b) * i

可以看成統和了『內積外積』︰

Dot product

In mathematics, the dot product or scalar product[note 1] is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number. In Euclidean geometry, the dot product of the Cartesian coordinates of two vectors is widely used and often called inner product (or rarely projection product); see also inner product space.

Algebraically, the dot product is the sum of the products of the corresponding entries of the two sequences of numbers. Geometrically, it is the product of the Euclidean magnitudes of the two vectors and the cosine of the angle between them. These definitions are equivalent when using Cartesian coordinates. In modern geometry, Euclidean spaces are often defined by using vector spaces. In this case, the dot product is used for defining lengths (the length of a vector is the square root of the dot product of the vector by itself) and angles (the cosine of the angle of two vectors is the quotient of their dot product by the product of their lengths).

The name “dot product” is derived from the centered dot ” · ” that is often used to designate this operation; the alternative name “scalar product” emphasizes that the result is a scalar, rather than a vector, which is the case for the vector product in three-dimensional space.

Scalar projection

Cross product

In mathematics and vector algebra, the cross product or vector product (occasionally directed area product to emphasize the geometric significance) is a binary operation on two vectors in three-dimensional space (R3) and is denoted by the symbol ×. Given two linearly independent vectors a and b, the cross product, a × b, is a vector that is perpendicular to both a and b and thus normal to the plane containing them. It has many applications in mathematics, physics, engineering, and computer programming. It should not be confused with dot product (projection product).

If two vectors have the same direction (or have the exact opposite direction from one another, i.e. are not linearly independent) or if either one has zero length, then their cross product is zero. More generally, the magnitude of the product equals the area of a parallelogram with the vectors for sides; in particular, the magnitude of the product of two perpendicular vectors is the product of their lengths. The cross product is anticommutative (i.e., a × b = −(b × a)) and is distributive over addition (i.e., a × (b + c) = a × b + a × c). The space R3 together with the cross product is an algebra over the real numbers, which is neither commutative nor associative, but is a Lie algebra with the cross product being the Lie bracket.

Like the dot product, it depends on the metric of Euclidean space, but unlike the dot product, it also depends on a choice of orientation or “handedness“. The product can be generalized in various ways; it can be made independent of orientation by changing the result to pseudovector, or in arbitrary dimensions the exterior product of vectors can be used with a bivector or two-form result. Also, using the orientation and metric structure just as for the traditional 3-dimensional cross product, one can in n dimensions take the product of n − 1 vectors to produce a vector perpendicular to all of them. But if the product is limited to non-trivial binary products with vector results, it exists only in three and seven dimensions.[1] If one adds the further requirement that the product be uniquely defined, then only the 3-dimensional cross product qualifies. (See § Generalizations, below, for other dimensions.)

The cross-product in respect to a right-handed coordinate system

 

,借之探討幾何上『垂直‧平行』矣。

雖然『SymPy』 的複數運算感覺有點陽春,依舊值得嚐鮮乎!◎

pi@raspberrypi:~ $ ipython3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from sympy import *

In [2]: init_printing()

In [3]: z, z1, z2 = symbols('z,z1,z2')

In [4]: x,y,x1,y1,x2,y2,t = symbols('x,y,x1,y1,x2,y2,t', real=True)

In [5]: z = x + y*I

In [6]: z1 = x1 + y1*I

In [7]: z2 = x2 + y2*I

In [8]: z
Out[8]: x + ⅈ⋅y

In [9]: conjugate(z)
Out[9]: x - ⅈ⋅y

In [10]: Abs(z)
Out[10]: 
   _________
  ╱  2    2 
╲╱  x  + y  

In [11]: arg(z)
Out[11]: arg(x + ⅈ⋅y)

In [12]: z1 + z2
Out[12]: x₁ + x₂ + ⅈ⋅y₁ + ⅈ⋅y₂

In [13]: re(z1 + z2)
Out[13]: x₁ + x₂

In [14]: im(z1 + z2)
Out[14]: y₁ + y₂

In [15]: z1 * z2
Out[15]: (x₁ + ⅈ⋅y₁)⋅(x₂ + ⅈ⋅y₂)

In [16]: re(z1 * z2)
Out[16]: x₁⋅x₂ - y₁⋅y₂

In [17]: im(z1 * z2)
Out[17]: x₁⋅y₂ + x₂⋅y₁

In [18]: exp(t*I)
Out[18]: 
 ⅈ⋅t
ℯ   

In [19]: exp(t*I).expand(complex=True)
Out[19]: ⅈ⋅sin(t) + cos(t)

In [20]: re(exp(t*I) *z)
Out[20]: x⋅cos(t) - y⋅sin(t)

In [21]: im(exp(t*I) *z)
Out[21]: x⋅sin(t) + y⋅cos(t)

In [22]: