|
diff --git a/docs/build/html/pylib.html b/docs/build/html/pylib.html
index f0fffdd..37a3d72 100644
--- a/docs/build/html/pylib.html
+++ b/docs/build/html/pylib.html
@@ -351,13 +351,37 @@ between consecutive terms).
+
+
+ pylib.drawblock module
+
+-
+
histogram(f, x=None)[source]
+Histogram chart with block symbols.
+
+- dots:
,_,
+|8|
+|7|
+|6|
+|5|
+|4|
+|3|
+|2|
+|1|
+```
+
+
+▁▂▃▄▅▆▇█
+12345678
+
+
pylib.function module
Mathematical equations.
- Date
-2019-11-04
+2019-11-15
@@ -565,9 +589,9 @@ which are normed to the range of [0, 1] to
w (int) – number of chars in horizontal direction
char_set (str) – either “braille” or “block”. “braille” uses Unicode
Characters in the Braille Patterns Block (fisrt index U+2800, last
-index U+28FF [CUDB]) and the “block” uses part of the Unicode
+index U+28FF [CUDB]) and the “block” uses part of the Unicode
Characters in the Block Elements Block (fisrt index U+2580, last
-index U+259F [CUDB]). Alias for braille is line and alias for
+index U+259F [CUDB]). Alias for braille is line and alias for
block is histogram
@@ -671,7 +695,7 @@ Example of 3 columns and 3 rows (upside down view of ‘normal’ braille/drawil
References
-- CUDB(1,2)
+- CUDB(1,2)
Unicode Database - Blocks
@@ -1144,10 +1168,10 @@ around a given origin. The angle should be given in radians.
pylib.mathematics module
- Mathematical functions.
+ Mathematical functions and objects.
- Date
-2019-10-30
+2019-12-12
@@ -1156,6 +1180,562 @@ around a given origin. The angle should be given in radians.
Compute the lowest common multiple of a and b
+
+-
+class
matrix[source]
+Bases: list
+Use/create matrix like list of lists
+
+-
+
rotate_x(theta)[source]
+Rotation about the x dirction.
+
+\[\begin{split}\begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx' & yy' & yz' & t_y' \\
+ zx' & zy' & zz' & t_z' \\
+ 0 & 0 & 0 & h
+\end{bmatrix} =
+\begin{bmatrix}
+ 1 & 0 & 0 & 0 \\
+ 0 & \cos \theta & -\sin \theta & 0 \\
+ 0 & \sin \theta & \cos \theta & 0 \\
+ 0 & 0 & 0 & h
+\end{bmatrix}
+\begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+\end{bmatrix}\end{split}\]
+
+
+
+-
+
rotate_y(theta)[source]
+Rotation about the y dirction.
+
+\[\begin{split}\begin{bmatrix}
+ xx' & xy' & xz' & t_x' \\
+ yx & yy & yz & t_y \\
+ zx' & zy' & zz' & t_z' \\
+ 0 & 0 & 0 & h
+\end{bmatrix} =
+\begin{bmatrix}
+ \cos \theta & 0 & \sin \theta & 0 \\
+ 0 & 1 & 0 & 0 \\
+ -\sin \theta & 0 & \cos \theta & 0 \\
+ 0 & 0 & 0 & h
+\end{bmatrix}
+\begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+\end{bmatrix}\end{split}\]
+
+
+
+-
+
rotate_z(theta)[source]
+Rotation about the z dirction.
+
+\[\begin{split}\begin{bmatrix}
+ xx' & xy' & xz' & t_x' \\
+ yx' & yy' & yz' & t_y' \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+\end{bmatrix} =
+\begin{bmatrix}
+ \cos \theta & -\sin \theta & 0 & 0 \\
+ \sin \theta & \cos \theta & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+\end{bmatrix}\end{split}\]
+
+
+
+-
+static
rx(theta)[source]
+Rotation matrix about the x direction.
+Rotates the coordinate system of vectors
+
+\[\begin{split}R_{x}(\theta) =
+\begin{bmatrix}
+ 1 & 0 & 0 & 0 \\
+ 0 & \cos \theta & -\sin \theta & 0 \\
+ 0 & \sin \theta & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}\end{split}\]
+
+
+
+-
+static
ry(theta)[source]
+Rotation matrix about the y direction.
+Rotates the coordinate system of vectors
+
+\[\begin{split}R_{y}(\theta) =
+\begin{bmatrix}
+ \cos \theta & 0 & \sin \theta & 0 \\
+ 0 & 1 & 0 & 0 \\
+ -\sin \theta & 0 & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}\end{split}\]
+
+
+
+-
+static
rz(theta)[source]
+Rotation matrix about the z direction.
+Rotates the coordinate system of vectors
+
+\[\begin{split}R_{z}(\theta) =
+\begin{bmatrix}
+ \cos \theta & -\sin \theta & 0 & 0 \\
+ \sin \theta & \cos \theta & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}\end{split}\]
+
+- Example
+
+
+
+\[\begin{split}R_{z}(\theta) \begin{bmatrix}1 \\ 0 \\ 0 \\ 1\end{bmatrix} =
+\begin{bmatrix}
+ \cos 90° & -\sin 90° & 0 & 0 \\
+ \sin 90° & \cos 90° & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}1 \\ 0 \\ 0 \\ 1\end{bmatrix} =
+\begin{bmatrix}
+ 0 & -1 & 0 & 0 \\
+ 1 & 0 & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}1 \\ 0 \\ 0 \\ 1\end{bmatrix} =
+\begin{bmatrix}0 \\ 1 \\ 0 \\ 1\end{bmatrix}\end{split}\]
+
+
+
+-
+static
s(sx, sy=None, sz=None)[source]
+Scaling matrix
+uniform scaling if sx=sy=sz=s.
+Note that scaling happens around the origin, so objects not
+centered at the origin will have their centers move. To avoid this,
+either scale the object when it’s located at the origin, or
+perform a translation afterwards to move the object back to where
+it should be.
+
+\[\begin{split}S =
+\begin{bmatrix}
+ s_x & 0 & 0 & 0 \\
+ 0 & s_y & 0 & 0 \\
+ 0 & 0 & s_z & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}\end{split}\]
+
+
+
+-
+
scale(sx, sy=None, sz=None)[source]
+Scaling
+uniform scaling if sx=sy=sz=s.
+Note that scaling happens around the origin, so objects not
+centered at the origin will have their centers move. To avoid this,
+either scale the object when it’s located at the origin, or
+perform a translation afterwards to move the object back to where
+it should be.
+
+\[\begin{split}\begin{bmatrix}
+ xx' & xy' & xz' & t_x' \\
+ yx' & yy' & yz' & t_y' \\
+ zx' & zy' & zz' & t_z' \\
+ 0 & 0 & 0 & h
+\end{bmatrix} =
+\begin{bmatrix}
+ s_x & 0 & 0 & 0 \\
+ 0 & s_y & 0 & 0 \\
+ 0 & 0 & s_z & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+\end{bmatrix}\end{split}\]
+
+
+
+-
+static
t(tx, ty, tz)[source]
+Translation matrix
+
+\[\begin{split}T =
+\begin{bmatrix}
+ 1 & 0 & 0 & t_x \\
+ 0 & 1 & 0 & t_y \\
+ 0 & 0 & 1 & t_z \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}\end{split}\]
+
+
+
+-
+
translate(tx, ty, tz)[source]
+Translation
+
+\[\begin{split}\begin{bmatrix}
+ xx & xy & xz & t_x' \\
+ yx & yy & yz & t_y' \\
+ zx & zy & zz & t_z' \\
+ 0 & 0 & 0 & h
+\end{bmatrix} =
+\begin{bmatrix}
+ 1 & 0 & 0 & t_x \\
+ 0 & 1 & 0 & t_y \\
+ 0 & 0 & 1 & t_z \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+\end{bmatrix}\end{split}\]
+
+
+
+
+
+-
+class
vector[source]
+Bases: list
+Use/create vector like lists
+
+size -> len(a)
+abs -> abs(a)
+dot -> a * b
+outer -> a @ b
+
+use super constructor
+use super __iter__
+use super __setitem__
+>>> v = vector([1,2,3,4,5])
+>>> v[3:5] = [1,2]
+>>> print(v)
+[1, 2, 3, 1, 2]
+>>> isinstance(v, vector)
+True
+
+
+use super __lt__(a, b)
+use super __le__(a, b)
+use super __eq__(a, b)
+>>> v = vector([1,2,3,1,2])
+>>> v2 = vector([1,2,3,1,2])
+>>> v == v2
+True
+
+
+use super __ne__(a, b)
+use super __ge__(a, b)
+use super __gt__(a, b)
+use super __contains__
+>>> 2 in vector([1,2,3])
+True
+
+
+__isub__
+>>> v = vector([1,2,3])
+>>> v -= vector([3,3,3])
+>>> print(v)
+[-2, -1, 0]
+
+
+__imul__
+>>> v = vector([1,2,3])
+>>> v *= vector([3,3,3])
+>>> print(v)
+18
+
+
+__imatmul__
+>>> m = vector([1,2,3])
+>>> m *= vector([3,3,3])
+>>> print(v)
+[[3, 3, 3], [6, 6, 6], [9, 9, 9]]
+
+
+
+-
+static
abs(a)[source]
+Return modulus parts of a complex vector
+
+
+
+
+
+-
+static
ang(a, b)[source]
+
+
+
+-
+static
arg(a)[source]
+Return phase parts of a complex vector
+
+
+
+
+
+-
+
ch_cs(cs)[source]
+Transform this vector from its defined coordinate system to a
+new coordinate system, defined by the given coordinate system (u,
+v and w direction vectors).
+
+\[\begin{split}\begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+\begin{bmatrix}
+ u_x & u_y & u_z & 0 \\
+ v_x & v_y & v_z & 0 \\
+ w_x & w_y & w_z & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}\end{split}\]
+
+
+
+-
+static
conjugate(a)[source]
+New vector object
+
+
+
+
+
+-
+static
cross(a, b)[source]
+Cross product
+
+
+c is orthogonal to both a and b.
+The direction of c can be found with the right-hand rule.
+
+\[\vec{c} = \vec{a} \times \vec{b}\]
+
+
+
+-
+static
full(length, fill_value)[source]
+Returns a vector of length m or matrix of size m rows, n
+columns filled with v.
+
+- Parameters
+-
+
+- Type fill_value
+scalar
+
+- Example
+
+
+>>> v = vector.full(3, 7)
+>>> print(v)
+[7, 7, 7]
+
+
+
+
+
+-
+static
im(a)[source]
+Return the imaginary parts of a complex vector
+
+
+
+
+
+-
+static
normalize(a)[source]
+Normalize a vector (i. e. the vector has a length of 1)
+
+
+
+\[\vec{e}_a = \frac{\vec{a}}{|\vec{a}|}\]
+
+ See also
+ norm() for a norm (magnitude) of a vector
+
+
+
+
+-
+static
ones(length)[source]
+Returns a vector of length m or matrix of size rows, n
+columns filled with ones.
+
+- Parameters
+length (int) – lhape of the vector, e. g. 3
+
+- Example
+
+
+>>> v = ones(3)
+>>> print(v)
+[1.0, 1.0, 1.0]
+
+
+
+
+
+-
+static
random(shape, lmin=0.0, lmax=1.0)[source]
+Returns a random vector of length n or matrix of size m rows, n
+columns filled with random numbers.
+
+- Example
+
+
+>>> v = random(3)
+>>> print(v)
+[0.9172905912930438, 0.8908124278322492, 0.5256002790725927]
+>>> v = random(3, 1, 2)
+>>> print(v)
+[1.2563665665080803, 1.9270454509964547, 1.2381672401270487]
+
+
+
+
+
+-
+static
re(a)[source]
+Return the real parts of a complex vector
+
+
+
+
+
+-
+
rotate_x(theta)[source]
+Rotation about the x dirction.
+
+\[\begin{split}\begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+\begin{bmatrix}
+ 1 & 0 & 0 & 0 \\
+ 0 & \cos \theta & -\sin \theta & 0 \\
+ 0 & \sin \theta & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}\end{split}\]
+
+
+
+-
+
rotate_y(theta)[source]
+Rotation about the y dirction.
+
+\[\begin{split}\begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+\begin{bmatrix}
+ \cos \theta & 0 & \sin \theta & 0 \\
+ 0 & 1 & 0 & 0 \\
+ -\sin \theta & 0 & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}\end{split}\]
+
+
+
+-
+
rotate_z(theta)[source]
+Rotation about the z dirction.
+
+\[\begin{split}\begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+\begin{bmatrix}
+ \cos \theta & -\sin \theta & 0 & 0 \\
+ \sin \theta & \cos \theta & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}\end{split}\]
+
+
+
+-
+
scale(sx, sy=None, sz=None)[source]
+Scaling
+uniform scaling if sx=sy=sz=s.
+Note that scaling happens around the origin, so objects not
+centered at the origin will have their centers move. To avoid this,
+either scale the object when it’s located at the origin, or
+perform a translation afterwards to move the object back to where
+it should be.
+
+\[\begin{split}\begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+\begin{bmatrix}
+ s_x & 0 & 0 & 0 \\
+ 0 & s_y & 0 & 0 \\
+ 0 & 0 & s_z & 0 \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}\end{split}\]
+
+
+
+-
+
translate(tx, ty, tz)[source]
+Translation
+
+\[\begin{split}\begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+\begin{bmatrix}
+ 1 & 0 & 0 & t_x \\
+ 0 & 1 & 0 & t_y \\
+ 0 & 0 & 1 & t_z \\
+ 0 & 0 & 0 & 1
+\end{bmatrix}
+\begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}\end{split}\]
+
+
+
+-
+
xyz()[source]
+
+
+
+-
+static
zeros(length)[source]
+Returns a zero vector of length m or matrix of size rows, n
+columns filled with zeros.
+
+- Parameters
+length (int) – length of the vector, e. g. 3
+
+- Example
+
+
+>>> v = zeros(3)
+>>> print(v)
+[0.0, 0.0, 0.0]
+
+
+
+
+
+
pylib.time_of_day module
diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js
index 7f8efaf..0d71a9b 100644
--- a/docs/build/html/searchindex.js
+++ b/docs/build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["data","date","function","geometry","geometry_plot","index","mathematics","modules","numerical","pylib","pylib.numerical","time_of_day"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["data.rst","date.rst","function.rst","geometry.rst","geometry_plot.rst","index.rst","mathematics.rst","modules.rst","numerical.rst","pylib.rst","pylib.numerical.rst","time_of_day.rst"],objects:{"":{"function":[9,0,0,"-"],data:[9,0,0,"-"],date:[9,0,0,"-"],fit:[10,0,0,"-"],geometry:[9,0,0,"-"],geometry_plot:[9,0,0,"-"],integration:[10,0,0,"-"],mathematics:[9,0,0,"-"],numerical:[8,0,0,"-"],ode:[10,0,0,"-"],ode_model:[10,0,0,"-"],pylib:[9,0,0,"-"],time_of_day:[9,0,0,"-"]},"function":{cosine_wave:[2,1,1,""],epitrochoid:[2,1,1,""],hypotrochoid:[2,1,1,""],sine_wave:[2,1,1,""],to_str:[2,1,1,""],transformation:[2,1,1,""]},"numerical.fit":{gauss:[8,1,1,""],gauss_fit:[8,1,1,""]},"numerical.integration":{trapez:[8,1,1,""]},"numerical.ode":{e1:[8,1,1,""],e2:[8,1,1,""],e4:[8,1,1,""],fpi:[8,1,1,""],i1:[8,1,1,""],newmark_newtonraphson:[8,1,1,""],newmark_newtonraphson_rdk:[8,1,1,""]},"numerical.ode_model":{disk:[8,1,1,""],disk_nm:[8,1,1,""],disk_nmmdk:[8,1,1,""]},"pylib.data":{fold_list:[9,1,1,""],get_id:[9,1,1,""],load:[9,1,1,""],read:[9,1,1,""],seq:[9,1,1,""],store:[9,1,1,""],unique_ending:[9,1,1,""],write:[9,1,1,""]},"pylib.date":{"gau\u00dfsche_osterformel":[9,1,1,""],ascension_of_jesus:[9,1,1,""],easter_friday:[9,1,1,""],easter_monday:[9,1,1,""],easter_sunday:[9,1,1,""],pentecost:[9,1,1,""]},"pylib.function":{cosine_wave:[9,1,1,""],epitrochoid:[9,1,1,""],hypotrochoid:[9,1,1,""],sine_wave:[9,1,1,""],to_str:[9,1,1,""],transformation:[9,1,1,""]},"pylib.geometry":{angle:[9,1,1,""],cubic:[9,1,1,""],cubic_deg:[9,1,1,""],cubics:[9,1,1,""],distance:[9,1,1,""],interpolate_hermite:[9,1,1,""],line:[9,1,1,""],lines:[9,1,1,""],rectangle:[9,1,1,""],rotate:[9,1,1,""],rotate_deg:[9,1,1,""],rotate_xy:[9,1,1,""],square:[9,1,1,""],translate:[9,1,1,""],translate_xy:[9,1,1,""]},"pylib.geometry_plot":{plot_cubic_lines:[9,1,1,""],plot_lines:[9,1,1,""]},"pylib.mathematics":{lcm:[9,1,1,""]},"pylib.numerical":{fit:[10,0,0,"-"],integration:[10,0,0,"-"],ode:[10,0,0,"-"],ode_model:[10,0,0,"-"]},"pylib.numerical.fit":{gauss:[10,1,1,""],gauss_fit:[10,1,1,""]},"pylib.numerical.integration":{trapez:[10,1,1,""]},"pylib.numerical.ode":{e1:[10,1,1,""],e2:[10,1,1,""],e4:[10,1,1,""],fpi:[10,1,1,""],i1:[10,1,1,""],newmark_newtonraphson:[10,1,1,""],newmark_newtonraphson_rdk:[10,1,1,""]},"pylib.numerical.ode_model":{disk:[10,1,1,""],disk_nm:[10,1,1,""],disk_nmmdk:[10,1,1,""]},"pylib.time_of_day":{days:[9,1,1,""],days_norm:[9,1,1,""],hours:[9,1,1,""],hours_norm:[9,1,1,""],in_seconds:[9,1,1,""],minutes:[9,1,1,""],minutes_norm:[9,1,1,""],seconds:[9,1,1,""],seconds_norm:[9,1,1,""],transform:[9,1,1,""]},data:{fold_list:[0,1,1,""],get_id:[0,1,1,""],load:[0,1,1,""],read:[0,1,1,""],seq:[0,1,1,""],store:[0,1,1,""],unique_ending:[0,1,1,""],write:[0,1,1,""]},date:{"gau\u00dfsche_osterformel":[1,1,1,""],ascension_of_jesus:[1,1,1,""],easter_friday:[1,1,1,""],easter_monday:[1,1,1,""],easter_sunday:[1,1,1,""],pentecost:[1,1,1,""]},geometry:{angle:[3,1,1,""],cubic:[3,1,1,""],cubic_deg:[3,1,1,""],cubics:[3,1,1,""],distance:[3,1,1,""],interpolate_hermite:[3,1,1,""],line:[3,1,1,""],lines:[3,1,1,""],rectangle:[3,1,1,""],rotate:[3,1,1,""],rotate_deg:[3,1,1,""],rotate_xy:[3,1,1,""],square:[3,1,1,""],translate:[3,1,1,""],translate_xy:[3,1,1,""]},geometry_plot:{plot_cubic_lines:[4,1,1,""],plot_lines:[4,1,1,""]},mathematics:{lcm:[6,1,1,""]},numerical:{fit:[8,0,0,"-"],integration:[8,0,0,"-"],ode:[8,0,0,"-"],ode_model:[8,0,0,"-"]},pylib:{"function":[9,0,0,"-"],data:[9,0,0,"-"],date:[9,0,0,"-"],geometry:[9,0,0,"-"],geometry_plot:[9,0,0,"-"],mathematics:[9,0,0,"-"],numerical:[10,0,0,"-"],time_of_day:[9,0,0,"-"]},time_of_day:{days:[11,1,1,""],days_norm:[11,1,1,""],hours:[11,1,1,""],hours_norm:[11,1,1,""],in_seconds:[11,1,1,""],minutes:[11,1,1,""],minutes_norm:[11,1,1,""],seconds:[11,1,1,""],seconds_norm:[11,1,1,""],transform:[11,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"1st":[8,10],"259f":[2,9],"28ff":[2,9],"2\u03c0f":[2,9],"2nd":[8,10],"4th":[8,10],"9fsche_osterformel":[1,9],"\u03bb":[2,9],"\u03bd":[2,9],"\u03c0":[2,9],"\u03c6":[2,9],"\u03c9":[2,9],"boolean":[2,9],"case":[2,8,9,10],"char":[0,2,9],"default":[0,2,3,8,9,10,11],"f\u00fcr":[1,9],"float":[0,2,3,8,9,10,11],"fr\u00fchling":[1,9],"function":[6,7,8,10],"gau\u00dfsch":[1,9],"gau\u00dfsche_osterformel":[1,9],"int":[0,1,2,3,8,9,10],"korrekturgr\u00f6\u00df":[1,9],"m\u00e4rz":[1,9],"m\u00e4rzdatum":[1,9],"new":[9,11],"return":[0,1,2,3,8,9,10,11],"s\u00e4kular":[1,9],"s\u00e4kularzahl":[1,9],"switch":[2,9],"true":[2,9],"vorw\u00e4rt":[8,10],Das:[1,9],The:[0,2,3,8,9,10,11],_____:[2,9],absolut:[3,9],addit:[3,9],against:[8,10],algorithmu:[1,9],alia:[2,9],als:[1,9],also:[2,9],amplitud:[2,8,9,10],analyt:[8,10],angl:[3,9],angle1:[3,9],angle2:[3,9],angular:[2,9],anim:[2,9],approx:[8,10],approxim:[8,10],april:[1,9],area:[8,10],argument:[2,3,9],arithmet:[0,9],around:[2,3,9],arrai:[0,9],ascens:[1,9],ascension_of_jesu:[1,9],ascii:[0,9],assum:[3,9],attach:[2,9],averag:[9,11],axi:[2,9],backward:[8,10],base:[8,10],becaus:[2,9],becom:[8,10],begin:[8,10],beta:[8,10],between:[0,2,3,9],binari:[0,9],block:[2,9],bmatrix:[8,10],bool:[0,2,8,9,10],bottom:[2,3,9],bound:[0,9],boundari:[3,9],braill:[2,9],build:[3,9],calcul:[1,8,9,10,11],call:[2,9],cauchi:[8,10],cdot:[8,10],center:[2,3,9],chang:[2,3,9],char_set:[2,9],charact:[2,9],characterist:[2,9],chart:[2,9],choos:[8,10],circl:[2,9],close:[0,9],column:[0,2,9],common:[0,6,9],composit:[8,10],comput:[6,9],condit:[3,8,9,10],consecut:[0,9],constant:[0,9],content:7,convert:[0,9,11],coordin:[3,9],cos:[2,9],cosin:[2,9],cosine_wav:[2,9],cosine_wave_degre:[],counterclockwis:[3,9],creat:[0,9],cubic:[3,9],cubic_deg:[3,9],cudb:[2,9],curv:[2,9],cycl:[2,9],dai:[1,9,11],data:[2,7,8,10],databas:[2,9],date:[0,2,3,4,6,7,8,10,11],datetim:[1,9],datum:[1,9],days_norm:[9,11],ddot:[8,10],decid:[3,9],defin:[3,9],definit:[8,10],deflect:[3,9],deform:[3,9],degener:[0,9],degre:[2,3,9],den:[1,9],densiti:[2,9],depend:[2,9],der:[1,9],derform:[3,9],deriv:[8,10],des:[1,9],describ:[2,8,9,10],deviat:[2,8,9,10],diamet:[8,10],die:[1,9],differ:[0,8,9,10],differenti:[8,10],dimens:[2,9],dimension:[0,9],dimenson:[0,9],direct:[2,3,9],disk:[8,10],disk_nm:[8,10],disk_nmmdk:[8,10],displac:[3,8,9,10],distanc:[2,3,9],distribut:[8,10],divid:[8,10],doe:[2,3,9],dot:[2,8,9,10],down:[2,9],drawil:[2,9],each:[2,3,9],easter:[1,9],easter_fridai:[1,9],easter_mondai:[1,9],easter_sundai:[1,9],eccentr:[8,10],edg:[3,9],either:[2,3,9],element:[0,2,3,9],empti:[0,9],emptyset:[0,9],end:[0,3,8,9,10],endpoint:[3,9],entfernung:[1,9],epitrochoid:[2,9],equal:[8,10],equalii:[8,10],equat:[2,8,9,10],error:[8,10],ersten:[1,9],euler:[8,10],everi:[8,10],exampl:[2,3,8,9,10],expect:[8,10],explicit:[8,10],explizit:[8,10],exterior:[2,9],f_n:[8,10],factor:[2,3,9],fail:[0,9],fals:[0,2,8,9,10],fassregel:[8,10],file:[0,9],file_nam:[0,9],filenam:[0,9],first:[0,2,3,8,9,10],fisrt:[2,9],fit:[7,9],fix:[2,8,9,10],float64:[8,10],fnm:[8,10],fold_list:[0,9],follow:[0,9],foral:[8,10],forward:[8,10],fourth:[8,10],fpi:[8,10],frac:[2,3,8,9,10],frame:[2,9],frequenc:[2,9],fridai:[1,9],from:[0,2,8,9,10],full:[0,8,9,10],function_cosine_wave_degre:[],function_sine_wave_degre:[],fwhm:[8,10],gamma:[8,10],gau:[1,9],gauss:[8,10],gauss_fit:[8,10],gener:[2,9],geometri:[4,7],geometry_plot:[3,7],get:[0,9],get_id:[0,9],gilt:[1,9],given:[0,3,8,9,10],global:[3,8,9,10],global_deform:[3,9],govern:[8,10],gregorian:[9,11],gregorianischen:[1,9],half:[8,10],has:[0,8,9,10],have:[2,9],head:[2,9],height:[3,9],hermit:[3,9],higher:[2,9],histogram:[2,9],horizont:[2,3,9],hour:[9,11],hours_norm:[9,11],http:[1,9],hyotrochoid:[2,9],hypotrochoid:[2,9],ids:[0,9],implicit:[8,10],in_second:[9,11],inc:[3,9],incid:[3,9],index:[0,2,3,5,9],index_offset:[3,9],inform:[0,8,9,10],initi:[8,10],insid:[2,9],integr:[7,9],integrand:[8,10],interior:[2,9],interpol:[3,9],interpolate_hermit:[3,9],interpret:[0,2,9],interv:[8,10],iter:[8,10],its:[2,9],jahr:[1,9],jesu:[1,9],johann:[8,10],kalend:[1,9],kalendarisch:[1,9],keim:[1,9],kepler:[8,10],keplersch:[8,10],keyword:[3,9],kutta:[8,10],kwarg:[3,4,9],kx1:[0,9],lag:[2,9],lambda:[2,8,9,10],last:[2,9],lcm:[2,6,9],ldot:[8,10],lead:[2,9],left:[0,2,3,8,9,10],leftrightarrow:[8,10],length:[0,3,9,11],leq:[8,10],lhd:[3,9],limit:[8,10],limits_:[8,10],limits_a:[8,10],line:[2,3,9],linear:[2,9],list:[0,2,3,8,9,10],lns:[4,9],load:[0,9],local:[8,10],lower:[0,8,9,10],lowest:[6,9],lst:[0,9],lvd:[3,9],lvert:[8,10],make:[2,9],manipul:[0,9],march:[1,9],mathemat:[2,7],mathmat:[8,10],mathrm:[2,8,9,10],matplotlib:[4,9],max:[2,9],max_iter:[8,10],maximum:[8,10],mean:[2,8,9,10],method:[8,10],min:[2,9],minumum:[0,9],minut:[9,11],minutes_norm:[9,11],model:[8,10],modul:[5,7],mondai:[1,9],mondparamet:[1,9],mondschaltung:[1,9],move:[2,9],multipl:[6,9],mxn:[0,9],ndarrai:[8,10],necessari:[8,10],necessarili:[8,10],newmark:[8,10],newmark_newtonraphson:[8,10],newmark_newtonraphson_rdk:[8,10],node:[3,9],non:[2,9],none:[0,2,3,8,9,10],norm:[2,9],normal:[2,9,11],number:[2,3,8,9,10],numer:[7,9],numerisch:[8,10],numpi:[8,10],object:[0,3,9],object_data:[0,9],occur:[2,9],ode:[7,9],ode_model:[7,9],offset:[8,9,10,11],often:[2,9],omega:[2,9],one:[0,2,3,8,9,10],onli:[0,9],open:[0,9],option:[2,3,9],order:[3,8,9,10],ordinari:[2,8,9,10],org:[1,9],origin:[3,9],oscil:[2,9],osterentfernung:[1,9],osterformel:[1,9],ostergrenz:[1,9],ostersonntag:[1,9],other:[3,9],otherwis:[3,9],outsid:[2,9],over:[2,9],packag:7,page:5,paramet:[0,1,2,3,8,9,10,11],part:[2,9],pattern:[2,9],peak:[2,9],pentecost:[1,9],per:[2,8,9,10],period:[2,9],phase:[2,9],phi:[2,9],pixel:[2,9],plane:[3,9],plot:[2,3,9],plot_cubic_lin:[4,9],plot_lin:[3,4,9],plotter:[4,9],point1:[3,9],point1_i:[3,9],point1_x:[3,9],point2:[3,9],point2_i:[3,9],point2_x:[3,9],point3:[3,9],point4:[3,9],point:[2,3,8,9,10],point_i:[3,9],point_x:[3,9],points1_i:[3,9],polygon:[3,9],polygonzugverfahren:[8,10],popt:[8,10],posit:[2,8,9,10],position_norm:[9,11],print:[3,8,9,10],problem:[8,10],program:[0,9],propag:[2,9],proport:[8,10],proportion:[2,9],pts:[3,9],pylab:[4,9],pylib:2,quad:[8,10],quadratur:[8,10],quasi:[2,9],radian:[2,3,9],radiu:[2,9],rang:[2,9,11],rate:[2,9],read:[0,9],rectangl:[3,9],refer:[2,9],relat:[2,9],repres:[2,9],residuum:[8,10],result:[2,9],rhd:[3,9],right:[0,2,3,8,9,10],roation:[3,9],roll:[2,9],rotat:[3,8,9,10],rotate_deg:[3,9],rotate_xi:[3,9],rotation_plan:[3,9],row:[2,9],rule:[8,10],rung:[8,10],rvd:[3,9],rvert:[8,10],said:[2,9],same:[0,9],sampl:[3,9],sample_point1_x:[3,9],sample_point2_i:[3,9],sample_point2_x:[3,9],sample_points1_i:[3,9],save_valu:[8,10],scale:[2,9],scale_horizont:[2,9],scale_i:[3,9],scale_vert:[2,9],scale_x:[3,9],sche:[8,10],search:5,second:[0,2,3,8,9,10,11],seconds_norm:[9,11],segment:[8,10],seq:[0,9],sequenc:[0,9],set:[2,8,9,10],shift:[2,9],shift_horizont:[2,9],shift_vert:[2,9],should:[3,9],side:[8,10],sigma:[8,10],simpson:[8,10],simpsonregel:[8,10],sin:[2,9],sine:[2,9],sine_wav:[2,9],sine_wave_degre:[],sinusoid:[2,9],size:[0,3,8,9,10],slope:[3,9],smooth:[2,9],solid:[3,9],solut:[8,10],solv:[8,10],solver:[8,10],sonnenschaltung:[1,9],sonntag:[1,9],sourc:[0,1,2,3,4,6,8,9,10,11],space:[8,10],spacial:[1,9],spatial:[2,9],special:[8,10],specif:[2,9],specifi:[2,8,9,10],speed:[2,9],sqrt:[8,10],squar:[3,8,9,10],stabl:[8,10],standard:[8,10],start:[0,2,3,9],step:[0,8,9,10],stop:[0,9],store:[0,9],str:[0,2,9],straight:[3,9],string:[2,3,9],struct_tim:[9,11],structur:[0,9],subinterv:[8,10],submodul:7,subpackag:[],sum:[8,10],sundai:[1,9],system:[3,8,9,10],t_0:[8,10],t_i:[8,10],tabl:[3,9],tagen:[1,9],term:[0,9],text:[8,10],than:[0,3,9],theata:[],therefor:[8,10],theta:[2,9],theta_end:[2,9],thi:[2,3,9],thick:[8,10],thicker:[2,9],thoma:[8,10],ti1:[8,10],time:[2,8,9,10,11],time_norm:[9,11],time_of_dai:7,to_str:[2,9],tol:[8,10],toler:[8,10],top:[3,9],torqu:[8,10],transform:[2,9,11],translat:[3,9],translate_xi:[3,9],trapez:[8,10],trapezium:[8,10],trapezoid:[8,10],trapezregel:[8,10],tupl:[0,2,3,8,9,10],two:[0,3,8,9,10],type:[0,1,2,3,8,9,10,11],typr:[2,9],uid:[0,9],unicod:[2,9],uniqu:[0,9],unique_end:[0,9],unit:[2,9],upper:[0,8,9,10],upsid:[2,9],usag:[2,9],used:[8,10],uses:[2,9],using:[4,8,9,10],usw:[1,9],valu:[2,8,9,10,11],varepsilon:[8,10],variabl:[1,2,8,9,10],varianc:[8,10],varphi:[2,9],vec:[3,9],vector:[3,9],veloc:[8,10],verbos:[0,8,9,10],verfahren:[8,10],vert_0:[8,10],vert_a:[8,10],vertcal:[3,9],vertic:[2,3,8,9,10],view:[2,9],vollmond:[1,9],von:[1,9],wave:[2,9],wavelength:[2,9],wavenumb:[2,9],what:[3,9],where:[2,8,9,10],which:[2,8,9,10],width:[2,3,8,9,10],wiki:[1,9],wikipedia:[1,9],window:[2,9],wise:[3,9],write:[0,9],x_0:[2,8,9,10],x_1:[2,3,8,9,10],x_2:[3,8,9,10],x_column:[0,9],x_fit:[8,10],x_i:[8,10],x_n:[8,10],xp0:[8,10],xpn:[8,10],xpp0:[8,10],xppn:[8,10],y_1:[3,9],y_2:[3,9],y_column:[0,9],y_fit:[8,10],year:[1,9,11],zero:[2,9]},titles:["data module","date module","function module","geometry module","geometry_plot module","Welcome to pylib\u2019s documentation!","mathematics module","pylib","numerical package","pylib package","pylib.numerical package","time_of_day module"],titleterms:{"function":[2,9],content:[8,9,10],data:[0,9],date:[1,9],document:5,fit:[8,10],geometri:[3,9],geometry_plot:[4,9],indic:5,integr:[8,10],mathemat:[6,9],modul:[0,1,2,3,4,6,8,9,10,11],numer:[8,10],ode:[8,10],ode_model:[8,10],packag:[8,9,10],pylib:[5,7,9,10],submodul:[8,9,10],subpackag:9,tabl:5,time_of_dai:[9,11],welcom:5}})
\ No newline at end of file
+Search.setIndex({docnames:["data","date","function","geometry","geometry_plot","index","mathematics","modules","numerical","pylib","pylib.numerical","time_of_day"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["data.rst","date.rst","function.rst","geometry.rst","geometry_plot.rst","index.rst","mathematics.rst","modules.rst","numerical.rst","pylib.rst","pylib.numerical.rst","time_of_day.rst"],objects:{"":{"function":[9,0,0,"-"],data:[9,0,0,"-"],date:[9,0,0,"-"],fit:[10,0,0,"-"],geometry:[9,0,0,"-"],geometry_plot:[9,0,0,"-"],integration:[10,0,0,"-"],mathematics:[9,0,0,"-"],numerical:[8,0,0,"-"],ode:[10,0,0,"-"],ode_model:[10,0,0,"-"],pylib:[9,0,0,"-"],time_of_day:[9,0,0,"-"]},"function":{cosine_wave:[2,1,1,""],epitrochoid:[2,1,1,""],hypotrochoid:[2,1,1,""],sine_wave:[2,1,1,""],to_str:[2,1,1,""],transformation:[2,1,1,""]},"mathematics.matrix":{rotate_x:[6,3,1,""],rotate_y:[6,3,1,""],rotate_z:[6,3,1,""],rx:[6,3,1,""],ry:[6,3,1,""],rz:[6,3,1,""],s:[6,3,1,""],scale:[6,3,1,""],t:[6,3,1,""],translate:[6,3,1,""]},"mathematics.vector":{abs:[6,3,1,""],ang:[6,3,1,""],arg:[6,3,1,""],ch_cs:[6,3,1,""],conjugate:[6,3,1,""],cross:[6,3,1,""],full:[6,3,1,""],im:[6,3,1,""],normalize:[6,3,1,""],ones:[6,3,1,""],random:[6,3,1,""],re:[6,3,1,""],rotate_x:[6,3,1,""],rotate_y:[6,3,1,""],rotate_z:[6,3,1,""],scale:[6,3,1,""],translate:[6,3,1,""],xyz:[6,3,1,""],zeros:[6,3,1,""]},"numerical.fit":{gauss:[8,1,1,""],gauss_fit:[8,1,1,""]},"numerical.integration":{trapez:[8,1,1,""]},"numerical.ode":{e1:[8,1,1,""],e2:[8,1,1,""],e4:[8,1,1,""],fpi:[8,1,1,""],i1:[8,1,1,""],newmark_newtonraphson:[8,1,1,""],newmark_newtonraphson_rdk:[8,1,1,""]},"numerical.ode_model":{disk:[8,1,1,""],disk_nm:[8,1,1,""],disk_nmmdk:[8,1,1,""]},"pylib.data":{fold_list:[9,1,1,""],get_id:[9,1,1,""],load:[9,1,1,""],read:[9,1,1,""],seq:[9,1,1,""],store:[9,1,1,""],unique_ending:[9,1,1,""],write:[9,1,1,""]},"pylib.date":{"gau\u00dfsche_osterformel":[9,1,1,""],ascension_of_jesus:[9,1,1,""],easter_friday:[9,1,1,""],easter_monday:[9,1,1,""],easter_sunday:[9,1,1,""],pentecost:[9,1,1,""]},"pylib.drawblock":{histogram:[9,1,1,""]},"pylib.function":{cosine_wave:[9,1,1,""],epitrochoid:[9,1,1,""],hypotrochoid:[9,1,1,""],sine_wave:[9,1,1,""],to_str:[9,1,1,""],transformation:[9,1,1,""]},"pylib.geometry":{angle:[9,1,1,""],cubic:[9,1,1,""],cubic_deg:[9,1,1,""],cubics:[9,1,1,""],distance:[9,1,1,""],interpolate_hermite:[9,1,1,""],line:[9,1,1,""],lines:[9,1,1,""],rectangle:[9,1,1,""],rotate:[9,1,1,""],rotate_deg:[9,1,1,""],rotate_xy:[9,1,1,""],square:[9,1,1,""],translate:[9,1,1,""],translate_xy:[9,1,1,""]},"pylib.geometry_plot":{plot_cubic_lines:[9,1,1,""],plot_lines:[9,1,1,""]},"pylib.mathematics":{lcm:[9,1,1,""],matrix:[9,2,1,""],vector:[9,2,1,""]},"pylib.mathematics.matrix":{rotate_x:[9,3,1,""],rotate_y:[9,3,1,""],rotate_z:[9,3,1,""],rx:[9,3,1,""],ry:[9,3,1,""],rz:[9,3,1,""],s:[9,3,1,""],scale:[9,3,1,""],t:[9,3,1,""],translate:[9,3,1,""]},"pylib.mathematics.vector":{abs:[9,3,1,""],ang:[9,3,1,""],arg:[9,3,1,""],ch_cs:[9,3,1,""],conjugate:[9,3,1,""],cross:[9,3,1,""],full:[9,3,1,""],im:[9,3,1,""],normalize:[9,3,1,""],ones:[9,3,1,""],random:[9,3,1,""],re:[9,3,1,""],rotate_x:[9,3,1,""],rotate_y:[9,3,1,""],rotate_z:[9,3,1,""],scale:[9,3,1,""],translate:[9,3,1,""],xyz:[9,3,1,""],zeros:[9,3,1,""]},"pylib.numerical":{fit:[10,0,0,"-"],integration:[10,0,0,"-"],ode:[10,0,0,"-"],ode_model:[10,0,0,"-"]},"pylib.numerical.fit":{gauss:[10,1,1,""],gauss_fit:[10,1,1,""]},"pylib.numerical.integration":{trapez:[10,1,1,""]},"pylib.numerical.ode":{e1:[10,1,1,""],e2:[10,1,1,""],e4:[10,1,1,""],fpi:[10,1,1,""],i1:[10,1,1,""],newmark_newtonraphson:[10,1,1,""],newmark_newtonraphson_rdk:[10,1,1,""]},"pylib.numerical.ode_model":{disk:[10,1,1,""],disk_nm:[10,1,1,""],disk_nmmdk:[10,1,1,""]},"pylib.time_of_day":{days:[9,1,1,""],days_norm:[9,1,1,""],hours:[9,1,1,""],hours_norm:[9,1,1,""],in_seconds:[9,1,1,""],minutes:[9,1,1,""],minutes_norm:[9,1,1,""],seconds:[9,1,1,""],seconds_norm:[9,1,1,""],transform:[9,1,1,""]},data:{fold_list:[0,1,1,""],get_id:[0,1,1,""],load:[0,1,1,""],read:[0,1,1,""],seq:[0,1,1,""],store:[0,1,1,""],unique_ending:[0,1,1,""],write:[0,1,1,""]},date:{"gau\u00dfsche_osterformel":[1,1,1,""],ascension_of_jesus:[1,1,1,""],easter_friday:[1,1,1,""],easter_monday:[1,1,1,""],easter_sunday:[1,1,1,""],pentecost:[1,1,1,""]},geometry:{angle:[3,1,1,""],cubic:[3,1,1,""],cubic_deg:[3,1,1,""],cubics:[3,1,1,""],distance:[3,1,1,""],interpolate_hermite:[3,1,1,""],line:[3,1,1,""],lines:[3,1,1,""],rectangle:[3,1,1,""],rotate:[3,1,1,""],rotate_deg:[3,1,1,""],rotate_xy:[3,1,1,""],square:[3,1,1,""],translate:[3,1,1,""],translate_xy:[3,1,1,""]},geometry_plot:{plot_cubic_lines:[4,1,1,""],plot_lines:[4,1,1,""]},mathematics:{lcm:[6,1,1,""],matrix:[6,2,1,""],vector:[6,2,1,""]},numerical:{fit:[8,0,0,"-"],integration:[8,0,0,"-"],ode:[8,0,0,"-"],ode_model:[8,0,0,"-"]},pylib:{"function":[9,0,0,"-"],data:[9,0,0,"-"],date:[9,0,0,"-"],drawblock:[9,0,0,"-"],geometry:[9,0,0,"-"],geometry_plot:[9,0,0,"-"],mathematics:[9,0,0,"-"],numerical:[10,0,0,"-"],time_of_day:[9,0,0,"-"]},time_of_day:{days:[11,1,1,""],days_norm:[11,1,1,""],hours:[11,1,1,""],hours_norm:[11,1,1,""],in_seconds:[11,1,1,""],minutes:[11,1,1,""],minutes_norm:[11,1,1,""],seconds:[11,1,1,""],seconds_norm:[11,1,1,""],transform:[11,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method"},terms:{"1st":[8,10],"259f":[2,9],"28ff":[2,9],"2\u03c0f":[2,9],"2nd":[8,10],"4th":[8,10],"9fsche_osterformel":[1,9],"\u03bb":[2,9],"\u03bd":[2,9],"\u03c0":[2,9],"\u03c6":[2,9],"\u03c9":[2,9],"boolean":[2,9],"case":[2,8,9,10],"char":[0,2,9],"class":[6,9],"default":[0,2,3,8,9,10,11],"f\u00fcr":[1,9],"float":[0,2,3,8,9,10,11],"fr\u00fchling":[1,9],"function":[6,7,8,10],"gau\u00dfsch":[1,9],"gau\u00dfsche_osterformel":[1,9],"int":[0,1,2,3,6,8,9,10],"korrekturgr\u00f6\u00df":[1,9],"m\u00e4rz":[1,9],"m\u00e4rzdatum":[1,9],"new":[6,9,11],"return":[0,1,2,3,6,8,9,10,11],"s\u00e4kular":[1,9],"s\u00e4kularzahl":[1,9],"static":[6,9],"super":[6,9],"switch":[2,9],"true":[2,6,9],"vorw\u00e4rt":[8,10],Das:[1,9],The:[0,2,3,6,8,9,10,11],Use:[6,9],_____:[2,9],__contains__:[6,9],__eq__:[6,9],__ge__:[6,9],__gt__:[6,9],__imatmul__:[6,9],__imul__:[6,9],__isub__:[6,9],__iter__:[6,9],__le__:[6,9],__lt__:[6,9],__ne__:[6,9],__setitem__:[6,9],about:[6,9],abs:[6,9],absolut:[3,9],addit:[3,9],afterward:[6,9],against:[8,10],algorithmu:[1,9],alia:[2,9],als:[1,9],also:[2,9],amplitud:[2,8,9,10],analyt:[8,10],ang:[6,9],angl:[3,9],angle1:[3,9],angle2:[3,9],angular:[2,9],anim:[2,9],approx:[8,10],approxim:[8,10],april:[1,9],area:[8,10],arg:[6,9],argument:[2,3,9],arithmet:[0,9],around:[2,3,6,9],arrai:[0,9],ascens:[1,9],ascension_of_jesu:[1,9],ascii:[0,9],assum:[3,9],attach:[2,9],averag:[9,11],avoid:[6,9],axi:[2,9],back:[6,9],backward:[8,10],base:[6,8,9,10],becaus:[2,9],becom:[8,10],begin:[6,8,9,10],beta:[8,10],between:[0,2,3,9],binari:[0,9],block:[2,9],bmatrix:[6,8,9,10],bool:[0,2,8,9,10],both:[6,9],bottom:[2,3,9],bound:[0,9],boundari:[3,9],braill:[2,9],build:[3,9],calcul:[1,8,9,10,11],call:[2,9],can:[6,9],cauchi:[8,10],cdot:[8,10],center:[2,3,6,9],ch_c:[6,9],chang:[2,3,9],char_set:[2,9],charact:[2,9],characterist:[2,9],chart:[2,9],choos:[8,10],circl:[2,9],close:[0,9],column:[0,2,6,9],common:[0,6,9],complex:[6,9],composit:[8,10],comput:[6,9],condit:[3,8,9,10],conjug:[6,9],consecut:[0,9],constant:[0,9],constructor:[6,9],content:7,convert:[0,9,11],coordin:[3,6,9],cos:[2,6,9],cosin:[2,9],cosine_wav:[2,9],cosine_wave_degre:[],counterclockwis:[3,9],creat:[0,6,9],cross:[6,9],cubic:[3,9],cubic_deg:[3,9],cudb:[2,9],curv:[2,9],cycl:[2,9],dai:[1,9,11],data:[2,7,8,10],databas:[2,9],date:[0,2,3,4,6,7,8,10,11],datetim:[1,9],datum:[1,9],days_norm:[9,11],ddot:[8,10],decid:[3,9],defin:[3,6,9],definit:[8,10],deflect:[3,9],deform:[3,9],degener:[0,9],degre:[2,3,9],den:[1,9],densiti:[2,9],depend:[2,9],der:[1,9],derform:[3,9],deriv:[8,10],des:[1,9],describ:[2,8,9,10],deviat:[2,8,9,10],diamet:[8,10],die:[1,9],differ:[0,8,9,10],differenti:[8,10],dimens:[2,9],dimension:[0,9],dimenson:[0,9],dirction:[6,9],direct:[2,3,6,9],disk:[8,10],disk_nm:[8,10],disk_nmmdk:[8,10],displac:[3,8,9,10],distanc:[2,3,9],distribut:[8,10],divid:[8,10],doe:[2,3,9],dot:[2,6,8,9,10],down:[2,9],drawblock:7,drawil:[2,9],each:[2,3,9],easter:[1,9],easter_fridai:[1,9],easter_mondai:[1,9],easter_sundai:[1,9],eccentr:[8,10],edg:[3,9],either:[2,3,6,9],element:[0,2,3,9],empti:[0,9],emptyset:[0,9],end:[0,3,6,8,9,10],endpoint:[3,9],entfernung:[1,9],epitrochoid:[2,9],equal:[8,10],equalii:[8,10],equat:[2,8,9,10],error:[8,10],ersten:[1,9],euler:[8,10],everi:[8,10],exampl:[2,3,6,8,9,10],expect:[8,10],explicit:[8,10],explizit:[8,10],exterior:[2,9],f_n:[8,10],factor:[2,3,9],fail:[0,9],fals:[0,2,8,9,10],fassregel:[8,10],file:[0,9],file_nam:[0,9],filenam:[0,9],fill:[6,9],fill_valu:[6,9],first:[0,2,3,8,9,10],fisrt:[2,9],fit:[7,9],fix:[2,8,9,10],float64:[8,10],fnm:[8,10],fold_list:[0,9],follow:[0,9],foral:[8,10],forward:[8,10],found:[6,9],fourth:[8,10],fpi:[8,10],frac:[2,3,6,8,9,10],frame:[2,9],frequenc:[2,9],fridai:[1,9],from:[0,2,6,8,9,10],full:[0,6,8,9,10],function_cosine_wave_degre:[],function_sine_wave_degre:[],fwhm:[8,10],gamma:[8,10],gau:[1,9],gauss:[8,10],gauss_fit:[8,10],gener:[2,9],geometri:[4,7],geometry_plot:[3,7],get:[0,9],get_id:[0,9],gilt:[1,9],given:[0,3,6,8,9,10],global:[3,8,9,10],global_deform:[3,9],govern:[8,10],gregorian:[9,11],gregorianischen:[1,9],half:[8,10],hand:[6,9],happen:[6,9],has:[0,6,8,9,10],have:[2,6,9],head:[2,9],height:[3,9],hermit:[3,9],higher:[2,9],histogram:[2,9],horizont:[2,3,9],hour:[9,11],hours_norm:[9,11],http:[1,9],hyotrochoid:[2,9],hypotrochoid:[2,9],ids:[0,9],imaginari:[6,9],implicit:[8,10],in_second:[9,11],inc:[3,9],incid:[3,9],index:[0,2,3,5,9],index_offset:[3,9],inform:[0,8,9,10],initi:[8,10],insid:[2,9],integr:[7,9],integrand:[8,10],interior:[2,9],interpol:[3,9],interpolate_hermit:[3,9],interpret:[0,2,9],interv:[8,10],isinst:[6,9],iter:[8,10],its:[2,6,9],jahr:[1,9],jesu:[1,9],johann:[8,10],kalend:[1,9],kalendarisch:[1,9],keim:[1,9],kepler:[8,10],keplersch:[8,10],keyword:[3,9],kutta:[8,10],kwarg:[3,4,9],kx1:[0,9],lag:[2,9],lambda:[2,8,9,10],last:[2,9],lcm:[2,6,9],ldot:[8,10],lead:[2,9],left:[0,2,3,8,9,10],leftrightarrow:[8,10],len:[6,9],length:[0,3,6,9,11],leq:[8,10],lhape:[6,9],lhd:[3,9],like:[6,9],limit:[8,10],limits_:[8,10],limits_a:[8,10],line:[2,3,9],linear:[2,9],list:[0,2,3,6,8,9,10],lmax:[6,9],lmin:[6,9],lns:[4,9],load:[0,9],local:[8,10],locat:[6,9],lower:[0,8,9,10],lowest:[6,9],lst:[0,9],lvd:[3,9],lvert:[8,10],magnitud:[6,9],make:[2,9],manipul:[0,9],march:[1,9],mathemat:[2,7],mathmat:[8,10],mathrm:[2,8,9,10],matplotlib:[4,9],matrix:[6,9],max:[2,9],max_iter:[8,10],maximum:[8,10],mean:[2,8,9,10],method:[8,10],min:[2,9],minumum:[0,9],minut:[9,11],minutes_norm:[9,11],model:[8,10],modul:[5,7],modulu:[6,9],mondai:[1,9],mondparamet:[1,9],mondschaltung:[1,9],move:[2,6,9],multipl:[6,9],mxn:[0,9],ndarrai:[8,10],necessari:[8,10],necessarili:[8,10],newmark:[8,10],newmark_newtonraphson:[8,10],newmark_newtonraphson_rdk:[8,10],node:[3,9],non:[2,9],none:[0,2,3,6,8,9,10],norm:[2,6,9],normal:[2,6,9,11],note:[6,9],number:[2,3,6,8,9,10],numer:[7,9],numerisch:[8,10],numpi:[8,10],object:[0,3,6,9],object_data:[0,9],occur:[2,9],ode:[7,9],ode_model:[7,9],offset:[8,9,10,11],often:[2,9],omega:[2,9],one:[0,2,3,8,9,10],ones:[6,9],onli:[0,9],open:[0,9],option:[2,3,9],order:[3,8,9,10],ordinari:[2,8,9,10],org:[1,9],origin:[3,6,9],orthogon:[6,9],oscil:[2,9],osterentfernung:[1,9],osterformel:[1,9],ostergrenz:[1,9],ostersonntag:[1,9],other:[3,9],otherwis:[3,9],outer:[6,9],outsid:[2,9],over:[2,9],packag:7,page:5,paramet:[0,1,2,3,6,8,9,10,11],part:[2,6,9],pattern:[2,9],peak:[2,9],pentecost:[1,9],per:[2,8,9,10],perform:[6,9],period:[2,9],phase:[2,6,9],phi:[2,9],pixel:[2,9],plane:[3,9],plot:[2,3,9],plot_cubic_lin:[4,9],plot_lin:[3,4,9],plotter:[4,9],point1:[3,9],point1_i:[3,9],point1_x:[3,9],point2:[3,9],point2_i:[3,9],point2_x:[3,9],point3:[3,9],point4:[3,9],point:[2,3,8,9,10],point_i:[3,9],point_x:[3,9],points1_i:[3,9],polygon:[3,9],polygonzugverfahren:[8,10],popt:[8,10],posit:[2,8,9,10],position_norm:[9,11],print:[3,6,8,9,10],problem:[8,10],product:[6,9],program:[0,9],propag:[2,9],proport:[8,10],proportion:[2,9],pts:[3,9],pylab:[4,9],pylib:2,quad:[8,10],quadratur:[8,10],quasi:[2,9],radian:[2,3,9],radiu:[2,9],random:[6,9],rang:[2,9,11],rate:[2,9],read:[0,9],real:[6,9],rectangl:[3,9],refer:[2,9],relat:[2,9],repres:[2,9],residuum:[8,10],result:[2,9],rhd:[3,9],right:[0,2,3,6,8,9,10],roation:[3,9],roll:[2,9],rotat:[3,6,8,9,10],rotate_deg:[3,9],rotate_i:[6,9],rotate_x:[6,9],rotate_xi:[3,9],rotate_z:[6,9],rotation_plan:[3,9],row:[2,6,9],rule:[6,8,9,10],rung:[8,10],rvd:[3,9],rvert:[8,10],s_x:[6,9],s_y:[6,9],s_z:[6,9],said:[2,9],same:[0,9],sampl:[3,9],sample_point1_x:[3,9],sample_point2_i:[3,9],sample_point2_x:[3,9],sample_points1_i:[3,9],save_valu:[8,10],scalar:[6,9],scale:[2,6,9],scale_horizont:[2,9],scale_i:[3,9],scale_vert:[2,9],scale_x:[3,9],sche:[8,10],search:5,second:[0,2,3,8,9,10,11],seconds_norm:[9,11],segment:[8,10],seq:[0,9],sequenc:[0,9],set:[2,8,9,10],shape:[6,9],shift:[2,9],shift_horizont:[2,9],shift_vert:[2,9],should:[3,6,9],side:[8,10],sigma:[8,10],simpson:[8,10],simpsonregel:[8,10],sin:[2,6,9],sine:[2,9],sine_wav:[2,9],sine_wave_degre:[],sinusoid:[2,9],size:[0,3,6,8,9,10],slope:[3,9],smooth:[2,9],solid:[3,9],solut:[8,10],solv:[8,10],solver:[8,10],sonnenschaltung:[1,9],sonntag:[1,9],sourc:[0,1,2,3,4,6,8,9,10,11],space:[8,10],spacial:[1,9],spatial:[2,9],special:[8,10],specif:[2,9],specifi:[2,8,9,10],speed:[2,9],sqrt:[8,10],squar:[3,8,9,10],stabl:[8,10],standard:[8,10],start:[0,2,3,9],step:[0,8,9,10],stop:[0,9],store:[0,9],str:[0,2,9],straight:[3,9],string:[2,3,9],struct_tim:[9,11],structur:[0,9],subinterv:[8,10],submodul:7,subpackag:7,sum:[8,10],sundai:[1,9],symbol:9,system:[3,6,8,9,10],t_0:[8,10],t_i:[8,10],t_x:[6,9],t_y:[6,9],t_z:[6,9],tabl:[3,9],tagen:[1,9],term:[0,9],text:[8,10],than:[0,3,9],theata:[],therefor:[8,10],theta:[2,6,9],theta_end:[2,9],thi:[2,3,6,9],thick:[8,10],thicker:[2,9],thoma:[8,10],ti1:[8,10],time:[2,6,8,9,10,11],time_norm:[9,11],time_of_dai:7,to_str:[2,9],tol:[8,10],toler:[8,10],top:[3,9],torqu:[8,10],transform:[2,6,9,11],translat:[3,6,9],translate_xi:[3,9],trapez:[8,10],trapezium:[8,10],trapezoid:[8,10],trapezregel:[8,10],tupl:[0,2,3,8,9,10],two:[0,3,8,9,10],type:[0,1,2,3,6,8,9,10,11],typr:[2,9],u_i:[6,9],u_x:[6,9],u_z:[6,9],uid:[0,9],unicod:[2,9],uniform:[6,9],uniqu:[0,9],unique_end:[0,9],unit:[2,9],upper:[0,8,9,10],upsid:[2,9],usag:[2,9],use:[6,9],used:[8,10],uses:[2,9],using:[4,8,9,10],usw:[1,9],v_x:[6,9],v_y:[6,9],v_z:[6,9],valu:[2,6,8,9,10,11],varepsilon:[8,10],variabl:[1,2,8,9,10],varianc:[8,10],varphi:[2,9],vec:[3,6,9],vector:[3,6,9],veloc:[8,10],verbos:[0,8,9,10],verfahren:[8,10],vert_0:[8,10],vert_a:[8,10],vertcal:[3,9],vertic:[2,3,8,9,10],view:[2,9],vollmond:[1,9],von:[1,9],w_x:[6,9],w_y:[6,9],w_z:[6,9],wave:[2,9],wavelength:[2,9],wavenumb:[2,9],what:[3,9],when:[6,9],where:[2,6,8,9,10],which:[2,8,9,10],width:[2,3,8,9,10],wiki:[1,9],wikipedia:[1,9],window:[2,9],wise:[3,9],write:[0,9],x_0:[2,8,9,10],x_1:[2,3,8,9,10],x_2:[3,8,9,10],x_column:[0,9],x_fit:[8,10],x_i:[8,10],x_n:[8,10],xp0:[8,10],xpn:[8,10],xpp0:[8,10],xppn:[8,10],xyz:[6,9],y_1:[3,9],y_2:[3,9],y_column:[0,9],y_fit:[8,10],year:[1,9,11],zero:[2,6,9]},titles:["data module","date module","function module","geometry module","geometry_plot module","Welcome to pylib\u2019s documentation!","mathematics module","pylib","numerical package","pylib package","pylib.numerical package","time_of_day module"],titleterms:{"function":[2,9],content:[8,9,10],data:[0,9],date:[1,9],document:5,drawblock:9,fit:[8,10],geometri:[3,9],geometry_plot:[4,9],indic:5,integr:[8,10],mathemat:[6,9],modul:[0,1,2,3,4,6,8,9,10,11],numer:[8,10],ode:[8,10],ode_model:[8,10],packag:[8,9,10],pylib:[5,7,9,10],submodul:[8,9,10],subpackag:9,tabl:5,time_of_dai:[9,11],welcom:5}})
\ No newline at end of file
diff --git a/docs/source/modules.rst b/docs/source/modules.rst
index 192f6ab..2773f7e 100644
--- a/docs/source/modules.rst
+++ b/docs/source/modules.rst
@@ -4,11 +4,4 @@ pylib
.. toctree::
:maxdepth: 4
- data
- date
- function
- geometry
- geometry_plot
- mathematics
- numerical
- time_of_day
+ pylib
diff --git a/docs/source/pylib.rst b/docs/source/pylib.rst
index f891b10..af4bdd2 100644
--- a/docs/source/pylib.rst
+++ b/docs/source/pylib.rst
@@ -27,6 +27,14 @@ pylib.date module
:undoc-members:
:show-inheritance:
+pylib.drawblock module
+----------------------
+
+.. automodule:: pylib.drawblock
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
pylib.function module
---------------------
diff --git a/pylib/mathematics.py b/pylib/mathematics.py
index 66f4910..b8ff0c7 100644
--- a/pylib/mathematics.py
+++ b/pylib/mathematics.py
@@ -1,12 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-"""Mathematical functions.
+"""Mathematical functions and objects.
-:Date: 2019-10-30
+:Date: 2019-12-12
.. module:: mathematics
:platform: *nix, Windows
- :synopsis: Mathematical functions.
+ :synopsis: Mathematical functions and objects.
.. moduleauthor:: Daniel Weschke
"""
@@ -15,3 +15,911 @@ from math import gcd
def lcm(a, b):
"""Compute the lowest common multiple of a and b"""
return a/gcd(a, b)*b
+
+
+class vector(list):
+ """Use/create vector like lists
+
+ * size -> len(a)
+ * abs -> abs(a)
+ * dot -> a * b
+ * outer -> a @ b
+
+ use super constructor
+
+ use super __iter__
+
+ use super __setitem__
+
+ >>> v = vector([1,2,3,4,5])
+ >>> v[3:5] = [1,2]
+ >>> print(v)
+ [1, 2, 3, 1, 2]
+ >>> isinstance(v, vector)
+ True
+
+ use super __lt__(a, b)
+
+ use super __le__(a, b)
+
+ use super __eq__(a, b)
+
+ >>> v = vector([1,2,3,1,2])
+ >>> v2 = vector([1,2,3,1,2])
+ >>> v == v2
+ True
+
+ use super __ne__(a, b)
+
+ use super __ge__(a, b)
+
+ use super __gt__(a, b)
+
+ use super __contains__
+
+ >>> 2 in vector([1,2,3])
+ True
+
+ __isub__
+
+ >>> v = vector([1,2,3])
+ >>> v -= vector([3,3,3])
+ >>> print(v)
+ [-2, -1, 0]
+
+ __imul__
+
+ >>> v = vector([1,2,3])
+ >>> v *= vector([3,3,3])
+ >>> print(v)
+ 18
+
+ __imatmul__
+
+ >>> m = vector([1,2,3])
+ >>> m *= vector([3,3,3])
+ >>> print(v)
+ [[3, 3, 3], [6, 6, 6], [9, 9, 9]]
+ """
+
+ def __getitem__(self, index):
+ """
+ For index return value, for range return new vector object.
+
+ :Example:
+
+ >>> v = vector([1, 2, 3, 4, 5])
+ >>> v[1:3]
+ [2, 3]
+ >>> v = vector([1, 2, 3, 4, 5])
+ >>> v[3]
+ 4
+ """
+ # use the list.__getslice__ method and convert result to vector
+ item = super().__getitem__(index)
+ return vector(item) if isinstance(item, list) else item
+
+ def __pos__(self):
+ """+ a (new object)
+ """
+ return vector([*self])
+
+ def __neg__(self):
+ """- a (new object)
+ """
+ return vector([-i for i in self])
+
+ def __add__(self, other):
+ """a + b (new object)
+
+ :Example:
+
+ >>> v = vector([1,2,3]) + vector([1,2,3])
+ >>> print(v)
+ [2, 4, 6]
+ """
+ return vector([i+j for i, j in zip(self, other)])
+
+ def __iadd__(self, other):
+ """a += b (new object)
+
+ :Example:
+
+ >>> v = vector([1,2,3])
+ >>> v += vector([3,3,3])
+ >>> print(v)
+ [4, 5, 6]
+ """
+ return vector([i+j for i, j in zip(self, other)])
+
+ def __sub__(self, other):
+ """a - b (new object)
+
+ :Example:
+
+ >>> v = vector([1,2,3]) - vector([1,2,3])
+ >>> print(v)
+ [0, 0, 0]
+ """
+ return vector([i-j for i, j in zip(self, other)])
+
+ def __mul__(self, other):
+ r"""Scalar multiplication, dot product (inner product) or
+ vector-matrix multiplication.
+
+ a * b (new object)
+
+ :type other: scalar, vector (or 1d list), matrix (or 2d list)
+
+ .. math::
+ \mathbf{c} &= \mathbf{a} \cdot b \\
+ \mathbf{c} &= \mathbf{a} \cdot \mathbf{b} \\
+ \mathbf{c} &= \mathbf{a} \cdot \mathbf{B}
+
+ .. note::
+ No size checking will be conducted, therefore no exceptions for
+ wrong usage (result will be nonsense).
+
+ :Example:
+
+ >>> v = vector([1,2,3,4,5])*3
+ >>> print(v)
+ [3, 6, 9, 12, 15]
+ >>> v = vector([1,2,3,4,5])*3.
+ >>> print(v)
+ [3.0, 6.0, 9.0, 12.0, 15.0]
+ >>> s = vector([1,2,3])*vector([1,2,3])
+ >>> print(s)
+ 14
+
+ .. seealso::
+ :meth:`__rmul__`
+ """
+ try: # vector * vector
+ return sum([i*j for i, j in zip(self, other)])
+ except:
+ try: # vector * matrix
+ return vector([sum(c*d for c, d in zip(self, b_col)) for b_col in zip(*other)])
+ except: # vector * scalar
+ return vector([i*other for i in self])
+
+ def __rmul__(self, other):
+ r"""Scalar multiplication, dot product (inner product) or
+ matrix-vector multiplication.
+
+ a * b (new object)
+
+ :type other: scalar (or 1d list and 2d list)
+
+ .. math::
+ \mathbf{c} &= a \cdot \mathbf{b} \\
+ \mathbf{c} &= \mathbf{a} \cdot \mathbf{b} \\
+ \mathbf{c} &= \mathbf{A} \cdot \mathbf{b}
+
+ .. note::
+ No size checking will be conducted, therefore no exceptions for
+ wrong usage (result will be nonsense).
+
+ :Example:
+
+ >>> v = 3*vector([1,2,3,4,5])
+ >>> print(v)
+ [3, 6, 9, 12, 15]
+ >>> v = 3.*vector([1,2,3,4,5])
+ >>> print(v)
+ [3.0, 6.0, 9.0, 12.0, 15.0]
+
+ .. seealso::
+ :meth:`__mul__`
+ :meth:`matrix.__mul__` for matrix * vector
+ """
+ try: # 2d list * vector (matrix * vector see matrix.__mul__)
+ return vector([sum(c*d for c, d in zip(a_row, self)) for a_row in other])
+ except: # scalar * vector
+ return self*other
+
+ def __matmul__(self, other):
+ r"""Outer product a @ b (new object)
+
+ .. math::
+ \vec{a} \otimes \vec{b}
+ =
+ \begin{pmatrix}
+ a_{1}\\
+ a_{2}\\
+ a_{3}
+ \end{pmatrix}
+ \otimes
+ \begin{pmatrix}
+ b_{1}\\
+ b_{2}\\
+ b_{3}
+ \end{pmatrix}
+ =
+ \begin{pmatrix}
+ a_{1}b_{1}&a_{1}b_{2}&a_{1}b_{3}\\
+ a_{2}b_{1}&a_{2}b_{2}&a_{2}b_{3}\\
+ a_{3}b_{1}&a_{3}b_{2}&a_{3}b_{3}
+ \end{pmatrix}
+
+
+ :Example:
+
+ >>> m = vector([1,2,3]) @ vector([1,2,4])
+ >>> print(m)
+ [[1, 2, 4], [2, 4, 8], [3, 6, 12]]
+ """
+ try: # vector * vector
+ return matrix([[i*j for j in other] for i in self])
+ except: # vector * number
+ return self*other
+
+ def __abs__(self):
+ r"""Magnitude / norm of a vector
+
+ .. math::
+ b = \sqrt{\sum a_i^2}
+
+ :Example:
+
+ >>> norm([3, 4])
+ 5
+ >>> norm(vector([3, 4]))
+ 5
+ """
+ return math.sqrt(self * self)
+
+ def __str__(self):
+ return str([*self])
+
+ def __repr__(self):
+ return "vector(" + str(self) + ")"
+
+ @staticmethod
+ def full(length, fill_value):
+ """Returns a vector of length m or matrix of size m rows, n
+ columns filled with v.
+
+ :param length: length of the vector, e. g. 3
+ :type length: int
+ :param fill_value: Fill value
+ :Type fill_value: scalar
+
+ :Example:
+
+ >>> v = vector.full(3, 7)
+ >>> print(v)
+ [7, 7, 7]
+ """
+ return vector([fill_value for i in range(length)])
+
+ @staticmethod
+ def zeros(length):
+ """Returns a zero vector of length m or matrix of size rows, n
+ columns filled with zeros.
+
+ :param length: length of the vector, e. g. 3
+ :type length: int
+
+ :Example:
+
+ >>> v = zeros(3)
+ >>> print(v)
+ [0.0, 0.0, 0.0]
+ """
+ return vector.full(length, 0.)
+
+ @staticmethod
+ def ones(length):
+ """Returns a vector of length m or matrix of size rows, n
+ columns filled with ones.
+
+ :param length: lhape of the vector, e. g. 3
+ :type length: int
+
+ :Example:
+
+ >>> v = ones(3)
+ >>> print(v)
+ [1.0, 1.0, 1.0]
+ """
+ return vector.full(length, 1.)
+
+ @staticmethod
+ def random(shape, lmin=0.0, lmax=1.0):
+ """Returns a random vector of length n or matrix of size m rows, n
+ columns filled with random numbers.
+
+ :Example:
+
+ >>> v = random(3)
+ >>> print(v)
+ [0.9172905912930438, 0.8908124278322492, 0.5256002790725927]
+ >>> v = random(3, 1, 2)
+ >>> print(v)
+ [1.2563665665080803, 1.9270454509964547, 1.2381672401270487]
+ """
+ import random
+ dl = lmax-lmin
+ return vector([dl*random.random()+lmin for i in range(shape)])
+
+ @staticmethod
+ def normalize(a):
+ r"""Normalize a vector (i. e. the vector has a length of 1)
+
+ :type a: vector
+
+ .. math::
+ \vec{e}_a = \frac{\vec{a}}{|\vec{a}|}
+
+ .. seealso::
+ :meth:`norm` for a norm (magnitude) of a vector
+ """
+ a_mag = abs(a)
+ return vector([i/a_mag for i in a])
+
+ @staticmethod
+ def ang(a, b):
+ return math.acos(a * b / (abs(a) * abs(b)))
+
+ @staticmethod
+ def conjugate(a):
+ """
+ New vector object
+
+ :type a: list
+ """
+ return vector([i.conjugate() for i in a])
+
+ @staticmethod
+ def re(a):
+ """Return the real parts of a complex vector
+
+ :type a: list
+ """
+ return vector([i.real for i in a])
+
+ @staticmethod
+ def im(a):
+ """Return the imaginary parts of a complex vector
+
+ :type a: list
+ """
+ return vector([i.imag for i in a])
+
+ @staticmethod
+ def abs(a):
+ """Return modulus parts of a complex vector
+
+ :type a: list
+ """
+ return vector([abs(i) for i in a])
+
+ @staticmethod
+ def arg(a):
+ """Return phase parts of a complex vector
+
+ :type a: list
+ """
+ return vector([math.atan2(i.imag, i.real) for i in a])
+
+ @staticmethod
+ def cross(a, b):
+ r"""Cross product
+
+ :type a: list
+ :type b: list
+
+ c is orthogonal to both a and b.
+ The direction of c can be found with the right-hand rule.
+
+ .. math::
+ \vec{c} = \vec{a} \times \vec{b}
+ """
+ return [a[1]*b[2] - a[2]*b[1],
+ a[2]*b[0] - a[0]*b[2],
+ a[0]*b[1] - a[1]*b[0]]
+
+ def xyz(self):
+ return self[:3]
+
+ def rotate_x(self, theta):
+ r"""Rotation about the x dirction.
+
+ .. math::
+ \begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+ \begin{bmatrix}
+ 1 & 0 & 0 & 0 \\
+ 0 & \cos \theta & -\sin \theta & 0 \\
+ 0 & \sin \theta & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}
+ """
+ self[:] = matrix.rx(theta) * self
+ return self
+
+ def rotate_y(self, theta):
+ r"""Rotation about the y dirction.
+
+ .. math::
+ \begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+ \begin{bmatrix}
+ \cos \theta & 0 & \sin \theta & 0 \\
+ 0 & 1 & 0 & 0 \\
+ -\sin \theta & 0 & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}
+ """
+ self[:] = matrix.ry(theta) * self
+ return self
+
+ def rotate_z(self, theta):
+ r"""Rotation about the z dirction.
+
+ .. math::
+ \begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+ \begin{bmatrix}
+ \cos \theta & -\sin \theta & 0 & 0 \\
+ \sin \theta & \cos \theta & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}
+ """
+ self[:] = matrix.rz(theta) * self
+ return self
+
+ def translate(self, tx, ty, tz):
+ r"""Translation
+
+ .. math::
+ \begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+ \begin{bmatrix}
+ 1 & 0 & 0 & t_x \\
+ 0 & 1 & 0 & t_y \\
+ 0 & 0 & 1 & t_z \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}
+ """
+ self[:] = matrix.t(tx, ty, tz) * self
+ return self
+
+ def scale(self, sx, sy=None, sz=None):
+ r"""Scaling
+
+ uniform scaling if sx=sy=sz=s.
+ Note that scaling happens around the origin, so objects not
+ centered at the origin will have their centers move. To avoid this,
+ either scale the object when it's located at the origin, or
+ perform a translation afterwards to move the object back to where
+ it should be.
+
+ .. math::
+ \begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+ \begin{bmatrix}
+ s_x & 0 & 0 & 0 \\
+ 0 & s_y & 0 & 0 \\
+ 0 & 0 & s_z & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}
+ """
+ if not sy:
+ sy = sx
+ sz = sx
+ self[:] = matrix.s(sx, sy, sz) * self
+ return self
+
+ def ch_cs(self, cs):
+ r"""Transform this vector from its defined coordinate system to a
+ new coordinate system, defined by the given coordinate system (u,
+ v and w direction vectors).
+
+ .. math::
+ \begin{bmatrix}x' \\ y' \\ z' \\ h'\end{bmatrix} =
+ \begin{bmatrix}
+ u_x & u_y & u_z & 0 \\
+ v_x & v_y & v_z & 0 \\
+ w_x & w_y & w_z & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}x \\ y \\ z \\ h\end{bmatrix}
+ """
+ self[:] = cs * self
+ return self
+
+class matrix(list):
+ """Use/create matrix like list of lists
+ """
+
+ def __getitem__(self, index):
+ """
+ For index return value, for range return new vector object.
+
+ :Example:
+
+ >>> m = matrix([[1, 2, 3, 0], [4, 5, 6, 0], [7, 8, 9, 0], [0, 0, 0, 0]])
+ >>> print(m[2])
+ [7, 8, 9, 0]
+ >>> print(m[:,1:3])
+ [[2, 3], [5, 6], [8, 9], [0, 0]]
+ >>> print(m[0:2,1:3])
+ [[2, 3], [5, 6]]
+ >>> print(m[::2,::2])
+ [[1, 3], [7, 9]]
+ """
+ # index: slice(stop), slice(start, stop[, step])
+ # for e. g. m[(1,3),:] -> index = ((1, 3), slice(None, None, None))
+ # use the list.__getslice__ method and convert result to vector
+ try: # 2d slicing (tuple of sclices)
+ item = [row.__getitem__(index[1]) for row in super().__getitem__(index[0])]
+ except: # 1d slicing
+ item = super().__getitem__(index)
+ return matrix(item) if isinstance(item, list) else item
+
+ @staticmethod
+ def rx(theta):
+ r"""Rotation matrix about the x direction.
+
+ Rotates the coordinate system of vectors
+
+ .. math::
+ R_{x}(\theta) =
+ \begin{bmatrix}
+ 1 & 0 & 0 & 0 \\
+ 0 & \cos \theta & -\sin \theta & 0 \\
+ 0 & \sin \theta & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ """
+ s = math.sin(theta)
+ c = math.cos(theta)
+ T = matrix([[ 1, 0, 0, 0],
+ [ 0, c,-s, 0],
+ [ 0, s, c, 0],
+ [ 0, 0, 0, 1]])
+ return T
+
+ @staticmethod
+ def ry(theta):
+ r"""Rotation matrix about the y direction.
+
+ Rotates the coordinate system of vectors
+
+ .. math::
+ R_{y}(\theta) =
+ \begin{bmatrix}
+ \cos \theta & 0 & \sin \theta & 0 \\
+ 0 & 1 & 0 & 0 \\
+ -\sin \theta & 0 & \cos \theta & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ """
+ s = math.sin(theta)
+ c = math.cos(theta)
+ T = matrix([[ c, 0, s, 0],
+ [ 0, 1, 0, 0],
+ [-s, 0, c, 0],
+ [ 0, 0, 0, 1]])
+ return T
+
+ @staticmethod
+ def rz(theta):
+ r"""Rotation matrix about the z direction.
+
+ Rotates the coordinate system of vectors
+
+ .. math::
+ R_{z}(\theta) =
+ \begin{bmatrix}
+ \cos \theta & -\sin \theta & 0 & 0 \\
+ \sin \theta & \cos \theta & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+
+ :Example:
+
+ .. math::
+ R_{z}(\theta) \begin{bmatrix}1 \\ 0 \\ 0 \\ 1\end{bmatrix} =
+ \begin{bmatrix}
+ \cos 90° & -\sin 90° & 0 & 0 \\
+ \sin 90° & \cos 90° & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}1 \\ 0 \\ 0 \\ 1\end{bmatrix} =
+ \begin{bmatrix}
+ 0 & -1 & 0 & 0 \\
+ 1 & 0 & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}1 \\ 0 \\ 0 \\ 1\end{bmatrix} =
+ \begin{bmatrix}0 \\ 1 \\ 0 \\ 1\end{bmatrix}
+ """
+ s = math.sin(theta)
+ c = math.cos(theta)
+ T = matrix([[ c,-s, 0, 0],
+ [ s, c, 0, 0],
+ [ 0, 0, 1, 0],
+ [ 0, 0, 0, 1]])
+ return T
+
+ @staticmethod
+ def t(tx, ty, tz):
+ r"""Translation matrix
+
+ .. math::
+ T =
+ \begin{bmatrix}
+ 1 & 0 & 0 & t_x \\
+ 0 & 1 & 0 & t_y \\
+ 0 & 0 & 1 & t_z \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ """
+ T = matrix([[ 1, 0, 0,tx],
+ [ 0, 1, 0,ty],
+ [ 0, 0, 1,tz],
+ [ 0, 0, 0, 1]])
+ return T
+
+ @staticmethod
+ def s(sx, sy=None, sz=None):
+ r"""Scaling matrix
+
+ uniform scaling if sx=sy=sz=s.
+ Note that scaling happens around the origin, so objects not
+ centered at the origin will have their centers move. To avoid this,
+ either scale the object when it's located at the origin, or
+ perform a translation afterwards to move the object back to where
+ it should be.
+
+ .. math::
+ S =
+ \begin{bmatrix}
+ s_x & 0 & 0 & 0 \\
+ 0 & s_y & 0 & 0 \\
+ 0 & 0 & s_z & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ """
+ if not sy:
+ sy = sx
+ sz = sx
+ T = matrix([[sx, 0, 0, 0],
+ [ 0,sy, 0, 0],
+ [ 0, 0,sz, 0],
+ [ 0, 0, 0, 1]])
+ return T
+
+ def __mul__(self, other):
+ r"""Scalar multiplication, dot product (inner product) or
+ matrix-vector multiplication.
+
+ a * b (new object)
+
+ :type other: scalar, vector (or 1d list), matrix (or 2d list)
+
+ .. math::
+ \mathbf{C} &= \mathbf{A} \cdot b \\
+ \mathbf{c} &= \mathbf{A} \cdot \mathbf{b} \\
+ \mathbf{C} &= \mathbf{A} \cdot \mathbf{B}
+
+ .. note::
+ No size checking will be conducted, therefore no exceptions for
+ wrong usage (result will be nonsense).
+
+ :Example:
+
+ >>> m = matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]]) * 5
+ >>> print(m)
+ [[5, 10, 15, 20], [25, 30, 35, 40], [45, 50, 55, 60], [0, 0, 0, 5]]
+ >>> m = matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]]) * 5.
+ >>> print(m)
+ [[5.0, 10.0, 15.0, 20.0], [25.0, 30.0, 35.0, 40.0], [45.0, 50.0, 55.0, 60.0], [0.0, 0.0, 0.0, 5.0]]
+ >>> v = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) * vector([12, 12, 13])
+ >>> print(v)
+ [75, 186, 297]
+ >>> m = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) * matrix([[12, 12, 13], [14, 15, 16], [17, 18, 19]])
+ >>> print(m)
+ [[91, 96, 102], [220, 231, 246], [349, 366, 390]]
+
+ .. seealso::
+ :meth:`__rmul__`
+ """
+ try: # matrix * matrix
+ return matrix([[sum(c*d for c, d in zip(a_row, b_col)) for b_col in zip(*other)] for a_row in self])
+ except:
+ try: # matrix * vector
+ return vector([sum(c*d for c, d in zip(a_row, other)) for a_row in self])
+ except: # matrix * scalar
+ return matrix([[a*other for a in a_row] for a_row in self])
+
+ def __rmul__(self, other):
+ r"""Scalar multiplication, dot product (inner product) or
+ vector-matrix multiplication.
+
+ a * b (new object)
+
+ :type other: scalar (or 1d list and 2d list)
+
+ .. math::
+ \mathbf{C} &= a \cdot \mathbf{B} \\
+ \mathbf{c} &= \mathbf{a} \cdot \mathbf{B} \\
+ \mathbf{C} &= \mathbf{A} \cdot \mathbf{B}
+
+ .. note::
+ No size checking will be conducted, therefore no exceptions for
+ wrong usage (result will be nonsense).
+
+ :Example:
+
+ >>> m = 5 * matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]]) * 5
+ >>> print(m)
+ [[5, 10, 15, 20], [25, 30, 35, 40], [45, 50, 55, 60], [0, 0, 0, 5]]
+ >>> m = 5. * matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]])
+ >>> print(m)
+ [[5.0, 10.0, 15.0, 20.0], [25.0, 30.0, 35.0, 40.0], [45.0, 50.0, 55.0, 60.0], [0.0, 0.0, 0.0, 5.0]]
+
+ .. seealso::
+ :meth:`__mul__`
+ :meth:`vector.__mul__` for vector * matrix
+ """
+ try: # 2d list * matrix (matrix * matrix see matrix.__mul__)
+ return matrix([[sum(c*d for c, d in zip(a_row, b_col)) for b_col in zip(*self)] for a_row in other])
+ except:
+ try: # 1d list * matrix (vector * matrix see vector.__mul__)
+ return vector([sum(c*d for c, d in zip(other, b_col)) for b_col in zip(*self)])
+ except: # scalar * vector
+ return self*other
+
+ def __str__(self):
+ return str([*self])
+
+ def __repr__(self):
+ return "matrix(" + str(self) + ")"
+
+ def rotate_x(self, theta):
+ r"""Rotation about the x dirction.
+
+ .. math::
+ \begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx' & yy' & yz' & t_y' \\
+ zx' & zy' & zz' & t_z' \\
+ 0 & 0 & 0 & h
+ \end{bmatrix} =
+ \begin{bmatrix}
+ 1 & 0 & 0 & 0 \\
+ 0 & \cos \theta & -\sin \theta & 0 \\
+ 0 & \sin \theta & \cos \theta & 0 \\
+ 0 & 0 & 0 & h
+ \end{bmatrix}
+ \begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+ \end{bmatrix}
+ """
+ self[:] = matrix.rx(theta) * self
+ return self
+
+ def rotate_y(self, theta):
+ r"""Rotation about the y dirction.
+
+ .. math::
+ \begin{bmatrix}
+ xx' & xy' & xz' & t_x' \\
+ yx & yy & yz & t_y \\
+ zx' & zy' & zz' & t_z' \\
+ 0 & 0 & 0 & h
+ \end{bmatrix} =
+ \begin{bmatrix}
+ \cos \theta & 0 & \sin \theta & 0 \\
+ 0 & 1 & 0 & 0 \\
+ -\sin \theta & 0 & \cos \theta & 0 \\
+ 0 & 0 & 0 & h
+ \end{bmatrix}
+ \begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+ \end{bmatrix}
+ """
+ self[:] = matrix.ry(theta) * self
+ return self
+
+ def rotate_z(self, theta):
+ r"""Rotation about the z dirction.
+
+ .. math::
+ \begin{bmatrix}
+ xx' & xy' & xz' & t_x' \\
+ yx' & yy' & yz' & t_y' \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+ \end{bmatrix} =
+ \begin{bmatrix}
+ \cos \theta & -\sin \theta & 0 & 0 \\
+ \sin \theta & \cos \theta & 0 & 0 \\
+ 0 & 0 & 1 & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+ \end{bmatrix}
+ """
+ self[:] = matrix.rz(theta) * self
+ return self
+
+ def translate(self, tx, ty, tz):
+ r"""Translation
+
+ .. math::
+ \begin{bmatrix}
+ xx & xy & xz & t_x' \\
+ yx & yy & yz & t_y' \\
+ zx & zy & zz & t_z' \\
+ 0 & 0 & 0 & h
+ \end{bmatrix} =
+ \begin{bmatrix}
+ 1 & 0 & 0 & t_x \\
+ 0 & 1 & 0 & t_y \\
+ 0 & 0 & 1 & t_z \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+ \end{bmatrix}
+ """
+ self[:] = matrix.t(tx, ty, tz) * self
+ return self
+
+ def scale(self, sx, sy=None, sz=None):
+ r"""Scaling
+
+ uniform scaling if sx=sy=sz=s.
+ Note that scaling happens around the origin, so objects not
+ centered at the origin will have their centers move. To avoid this,
+ either scale the object when it's located at the origin, or
+ perform a translation afterwards to move the object back to where
+ it should be.
+
+ .. math::
+ \begin{bmatrix}
+ xx' & xy' & xz' & t_x' \\
+ yx' & yy' & yz' & t_y' \\
+ zx' & zy' & zz' & t_z' \\
+ 0 & 0 & 0 & h
+ \end{bmatrix} =
+ \begin{bmatrix}
+ s_x & 0 & 0 & 0 \\
+ 0 & s_y & 0 & 0 \\
+ 0 & 0 & s_z & 0 \\
+ 0 & 0 & 0 & 1
+ \end{bmatrix}
+ \begin{bmatrix}
+ xx & xy & xz & t_x \\
+ yx & yy & yz & t_y \\
+ zx & zy & zz & t_z \\
+ 0 & 0 & 0 & h
+ \end{bmatrix}
+ """
+ if not sy:
+ sy = sx
+ sz = sx
+ self[:] = matrix.s(sx, sy, sz) * self
+ return self
|