I already checked below questions:
Plot Ellipse with matplotlib.pyplot (Python)
How to find the point on ellipse given the angle
I'm trying to find a point coordinates on rotated ellipse, actually I need the point coordinates that can be shown on image.
Here is the code, most of the them from the first SO question.
u=1. #x-position of the center
v=0.5 #y-position of the center
a=2. #radius on the x-axis
b=1.5 #radius on the y-axis
t_rot=pi/4 #rotation angle
angle = 15 # always on blue circle
t = np.linspace(0, 2*pi, 100)
Ell = np.array([a*np.cos(t) , b*np.sin(t)])
#u,v removed to keep the same center location
R_rot = np.array([[cos(t_rot) , -sin(t_rot)],[sin(t_rot) , cos(t_rot)]])
#2-D rotation matrix
Ell_rot = np.zeros((2,Ell.shape[1]))
for i in range(Ell.shape[1]):
Ell_rot[:,i] = np.dot(R_rot,Ell[:,i])
#ellipses
plt.plot( u+Ell[0,:] , v+Ell[1,:] ) #initial ellipse
plt.plot( u+Ell_rot[0,:] , v+Ell_rot[1,:],'magenta' ) #rotated ellipse
#points
plt.scatter(u,v,s=10,color='black') # center
plt.scatter(u + a*cos(angle),v + b*sin(angle),s=50,color='black') #point on blue ellipse
plt.grid(color='lightgray',linestyle='--')
plt.show()
If I change the angle I got a point on not-rotated ellipse(black point).
What I want to do is find the points on the rotated ellipse that I tagged artificially with red. Basically these are the points on ellipse which have minimum&maximum x-y values.
Any suggestions?
Thanks a lot!