how can i plot this 2 variable maths equation on a 3d plot

i want to plot this equation in 3d x axis being theta y axis being lamda and the result being the z axis
(1+(2*(cos(theta)**2 +4 * (lamda)*(sqrt(1-lamda**2))*(cos(theta))*(sin(theta))))

Respuestas (1)

Try this:
thetav = linspace(0, 2*pi, 50);
lambdav = linspace(0, 10, 25);
[Th,Lb] = ndgrid(thetav, lambdav);
Z = @(theta,lamda) 1+(2*(cos(theta).^2 +4 .* (lamda).*(sqrt(1-lamda.^2)).*(cos(theta)).*(sin(theta)))) ;
figure
surf(Th, Lb, real(Z(Th,Lb)))
figure
surf(Th, Lb, imag(Z(Th,Lb)))
figure
surf(Th, Lb, abs(Z(Th,Lb)))
.

Preguntada:

el 26 de Mzo. de 2021

Respondida:

el 26 de Mzo. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by