Skip to content

Instantly share code, notes, and snippets.

@silgon
Last active June 5, 2024 12:32
Show Gist options
  • Save silgon/22b09b0a4c372dd84ccb7f59736e0327 to your computer and use it in GitHub Desktop.
Save silgon/22b09b0a4c372dd84ccb7f59736e0327 to your computer and use it in GitHub Desktop.

image

with p = np.linspace(7/8*1j*2*np.pi,1j*2*np.pi,10)

image

with p = np.linspace(3/8*1j*2*np.pi,5/8*1j*2*np.pi,10) image

reference: Book: Problems and Solutions in Introductory and Advanced Matrix Calculus Problem 35

import numpy as np
import matplotlib.pyplot as plt
p = np.linspace(0,1j*2*np.pi,50)
θ = np.linspace(0,np.pi/2,50)
P,Θ = np.meshgrid(p,θ)
m = np.exp(P)*np.sin(Θ)*np.cos(Θ) + np.sin(Θ)**2
b = m.flatten()
r,i = np.real(b), np.imag(b)
plt.scatter(r,i)
plt.axis('equal')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment