Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makePlanet(vec, rad)
- %the sphere(N) function will create three N+1 by N+1 matrices that are x, y,
- %and z coordinates to a unit sphere
- [x, y, z] = sphere(30);
- %apply the radius and position changes
- newx = x*rad + vec(1);
- newy = y*rad + vec(2);
- newz = z*rad + vec(3);
- %plot it
- surf(newx, newy, newz);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement