Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

License: CC-BY-NC-SA 4.0

I found an issue

Thank you! Please report it at https://github.com/MarinhoLab/OpenExecutableBooksRobotics/issues

Latex Macros

\providecommand{\myvec}[1]{{\mathbf{\boldsymbol{{#1}}}}} \providecommand{\mymatrix}[1]{{\mathbf{\boldsymbol{{#1}}}}}

\providecommand{\myvec}[1]{{\mathbf{\boldsymbol{{#1}}}}}
\providecommand{\mymatrix}[1]{{\mathbf{\boldsymbol{{#1}}}}}

Valid imports

from math import pi, sin, cos
import numpy as np

Exercises

Exercise 1

phi = pi/4.0

e1 = sin(phi) + 4 * cos(phi / 5)

# Printing the result is NOT a mandatory part of the answer.
print(f'e1 = {e1}')
e1 = 4.657860143567099

Exercise 2

A2 = np.array([[5, 2],
              [3, 5]])
B2 = np.array([[5, 3],
              [3, 8]])

C2 = A2 + B2 + (A2 @ B2) - (B2 @ A2)

# Printing the result is NOT a mandatory part of the answer.
print(f'C2 = {C2}')
C2 = [[ 7 11]
 [-3 16]]