main.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. from auditorium import Show
  2. from auditorium.show import Context
  3. show = Show('My Show')
  4. @show.slide
  5. def intro(ctx):
  6. """
  7. ### Mathematical Foundation of Algorithms
  8. Algebra - Complex Numbers
  9. """
  10. @show.slide
  11. def score(ctx):
  12. """
  13. Each day homework will have a value of 12 points.
  14. - Homework: 12 * 12 = 144 points
  15. - Final Exam: 56 points (Mandatory participation)
  16. - Maximum grade: 180 points
  17. """
  18. @show.slide
  19. def complex_number(ctx):
  20. """
  21. ## Complex numbers
  22. $$\sqrt{-1} = ?$$
  23. """
  24. @complex_number.slide
  25. def complex_number_inner_1(ctx):
  26. """
  27. ## Complex numbers
  28. $$i^2 = -1$$
  29. $$i = \sqrt{-1}$$
  30. """
  31. @complex_number.slide
  32. def complex_number_inner_2(ctx):
  33. """
  34. ## Complex numbers
  35. $$i^2 = -1$$
  36. $$i = \sqrt{-1}$$
  37. """
  38. @complex_number.slide
  39. def introduction_to_complex(ctx):
  40. """
  41. ## Introduction to complex numbers
  42. """
  43. @complex_number.slide
  44. def implement_complex_number(ctx):
  45. """
  46. ## Implement complex number
  47. """
  48. @show.slide
  49. def triangles(ctx):
  50. """
  51. ## Draw triangles
  52. """
  53. @show.slide
  54. def complex_number_inner(ctx):
  55. """
  56. ## Draw complex fractals
  57. """
  58. @ show.slide
  59. def homework(ctx):
  60. """
  61. Homework
  62. """
  63. @homework.slide
  64. def task_1(ctx):
  65. """
  66. `**`
  67. Implement remaining methods of complex number:
  68. - substraction
  69. - multiplication
  70. - division
  71. - exponentiation
  72. """
  73. @homework.slide
  74. def task_2(ctx):
  75. """
  76. `**`
  77. Given a polynomial of degree 2:
  78. $$a \cdot x^2 + b \cdot x + c$$
  79. Compute the roots of this polynomial
  80. """
  81. @homework.slide
  82. def task_3(ctx):
  83. """
  84. `***`
  85. Prove that:
  86. $$(\\cos \\theta + i \\sin \\theta)^n = \\cos n \\theta + i \\sin n \\theta$$
  87. """
  88. @homework.slide
  89. def task_4(ctx):
  90. """
  91. `**`
  92. 1. Given a complex number in rectangular form, convert to polar form.
  93. 2. Given a complex number in polar form, convert to rectangular form.
  94. """
  95. @show.slide
  96. def bye(ctx):
  97. """
  98. ### Mathematical Foundation of Algorithms
  99. Algebra - Complex Numbers
  100. """