Skip to content

Instantly share code, notes, and snippets.

@snowman
Created February 12, 2018 10:18
Show Gist options
  • Save snowman/dd5a7d2ef7a76eff0b1fcd5b9d5dc00b to your computer and use it in GitHub Desktop.
Save snowman/dd5a7d2ef7a76eff0b1fcd5b9d5dc00b to your computer and use it in GitHub Desktop.
theta = linspace(0, 2*pi, 40);
phi = linspace(0, pi, 40);
[theta, phi] = meshgrid(theta, phi);
rho=1;
x = rho * sin(phi) .* cos(theta);
y = rho * sin(phi) .* sin(theta);
z = rho * cos(phi);
mesh(x, y, z);
axis equal
grid on
box on
view([130,30])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment