Skip to content

Fixes to questions 2, 9, 18, 31, 35, 44, 52, 56, 66 & 78 #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify answer 44 using np.hypot
  • Loading branch information
Nikolaos Korasidis committed Mar 11, 2020
commit e5a13fdb4d10bbd95c3ce06ab13f3f6369a8b41e
4 changes: 2 additions & 2 deletions source/exercises100.ktx
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,12 @@ Z[0] = 1
Consider a random 10x2 matrix representing cartesian coordinates, convert them to polar coordinates (★★☆)

< h44
hint: np.sqrt, np.arctan2
hint: np.hypot, np.arctan2

< a44
Z = np.random.random((10,2))
X,Y = Z[:,0], Z[:,1]
R = np.sqrt(X**2+Y**2)
R = np.hypot(Y,X)
T = np.arctan2(Y,X)
print(R)
print(T)
Expand Down