|
@@ -0,0 +1,145 @@
|
|
|
|
+from auditorium import Show
|
|
|
|
+from auditorium.show import Context
|
|
|
|
+
|
|
|
|
+show = Show('My Show')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@show.slide
|
|
|
|
+def intro(ctx):
|
|
|
|
+ """
|
|
|
|
+ ### Mathematical Foundation of Algorithms
|
|
|
|
+
|
|
|
|
+ Algebra - Complex Numbers
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@show.slide
|
|
|
|
+def score(ctx):
|
|
|
|
+ """
|
|
|
|
+ Each day homework will have a value of 12 points.
|
|
|
|
+
|
|
|
|
+ - Homework: 12 * 12 = 144 points
|
|
|
|
+ - Final Exam: 56 points (Mandatory participation)
|
|
|
|
+ - Maximum grade: 180 points
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@show.slide
|
|
|
|
+def complex_number(ctx):
|
|
|
|
+ """
|
|
|
|
+ ## Complex numbers
|
|
|
|
+
|
|
|
|
+ $$\sqrt{-1} = ?$$
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@complex_number.slide
|
|
|
|
+def complex_number_inner_1(ctx):
|
|
|
|
+ """
|
|
|
|
+ ## Complex numbers
|
|
|
|
+
|
|
|
|
+ $$i^2 = -1$$
|
|
|
|
+ $$i = \sqrt{-1}$$
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@complex_number.slide
|
|
|
|
+def complex_number_inner_2(ctx):
|
|
|
|
+ """
|
|
|
|
+ ## Complex numbers
|
|
|
|
+
|
|
|
|
+ $$i^2 = -1$$
|
|
|
|
+ $$i = \sqrt{-1}$$
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@complex_number.slide
|
|
|
|
+def introduction_to_complex(ctx):
|
|
|
|
+ """
|
|
|
|
+ ## Introduction to complex numbers
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@complex_number.slide
|
|
|
|
+def implement_complex_number(ctx):
|
|
|
|
+ """
|
|
|
|
+ ## Implement complex number
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@show.slide
|
|
|
|
+def triangles(ctx):
|
|
|
|
+ """
|
|
|
|
+ ## Draw triangles
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@show.slide
|
|
|
|
+def complex_number_inner(ctx):
|
|
|
|
+ """
|
|
|
|
+ ## Draw complex fractals
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@ show.slide
|
|
|
|
+def homework(ctx):
|
|
|
|
+ """
|
|
|
|
+ Homework
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@homework.slide
|
|
|
|
+def task_1(ctx):
|
|
|
|
+ """
|
|
|
|
+ `**`
|
|
|
|
+
|
|
|
|
+ Implement remaining methods of complex number:
|
|
|
|
+
|
|
|
|
+ - substraction
|
|
|
|
+ - multiplication
|
|
|
|
+ - division
|
|
|
|
+ - exponentiation
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@homework.slide
|
|
|
|
+def task_2(ctx):
|
|
|
|
+ """
|
|
|
|
+ `**`
|
|
|
|
+
|
|
|
|
+ Given a polynomial of degree 2:
|
|
|
|
+
|
|
|
|
+ $$a \cdot x^2 + b \cdot x + c$$
|
|
|
|
+
|
|
|
|
+ Compute the roots of this polynomial
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@homework.slide
|
|
|
|
+def task_3(ctx):
|
|
|
|
+ """
|
|
|
|
+ `***`
|
|
|
|
+
|
|
|
|
+ Prove that:
|
|
|
|
+
|
|
|
|
+ $$(\\cos \\theta + i \\sin \\theta)^n = \\cos n \\theta + i \\sin n \\theta$$
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@homework.slide
|
|
|
|
+def task_4(ctx):
|
|
|
|
+ """
|
|
|
|
+ `**`
|
|
|
|
+
|
|
|
|
+ 1. Given a complex number in rectangular form, convert to polar form.
|
|
|
|
+ 2. Given a complex number in polar form, convert to rectangular form.
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@show.slide
|
|
|
|
+def bye(ctx):
|
|
|
|
+ """
|
|
|
|
+ ### Mathematical Foundation of Algorithms
|
|
|
|
+
|
|
|
|
+ Algebra - Complex Numbers
|
|
|
|
+ """
|