I have the following equation:
z*cos(theta)-x*sin(theta)=[A-B*[z*sin(theta)+x*cos(theta)]^2-B*y^2]
My Goal: I need the values of z, for a given range of x and y values on a square -40 to 40 for both x & y.
I'd like to solve this in python. I've noticed that there's a similar problem, but I need the value of z, not just the graph: Plot curve equation without solving for dependent variable in matplotlib? I'm not sure if matplotlib is doing some kind of optimization in order to find the values of y for that problem? If it's possible to extract the values of z directly from the plot that would be fine, however something is also wrong with my definition of this contour plot (I've made many contour plots when I knew what values I wanted on the Z-axis, but never when I didn't know how to solve for Z.
`theta = math.pi/12
A = scalar
B = scalar
step = 1
X, Y, Z = np.meshgrid(np.arange(-40,40,step), np.arange(-40,40,step), np.arange(-40,40,step))
plt.contour(X,Y, Z*np.cos(theta)-X*np.sin(theta), A-B*[Z*np.sin(theta)+X*np.cos(theta)]^2-B*Y^2)
plt.show()`
I'm not sure if I need a solver like scipy optimize, Fzero, or a crazy version of excel's solver? I noticed that Wolfram Alpha can plot a nice contour plot of the equation given values for theta, A, and B, but nonetheless it still doesn't provide me with values for z, given set values for x and y.
Thanks for your help,