ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 03 Feb 2019 15:56:13 +0100How plot revolution of a circle to generate a sphere by animation view?https://ask.sagemath.org/question/45287/how-plot-revolution-of-a-circle-to-generate-a-sphere-by-animation-view/ I would like to plot a sphere $x^2+y^2+z^2=4$ by revolving a circle $x^2+y^2=4$ with respect to diameter. The whole revolution process will be shown by animation. How can I do this? Sun, 03 Feb 2019 14:47:58 +0100https://ask.sagemath.org/question/45287/how-plot-revolution-of-a-circle-to-generate-a-sphere-by-animation-view/Answer by tmonteil for <p>I would like to plot a sphere $x^2+y^2+z^2=4$ by revolving a circle $x^2+y^2=4$ with respect to diameter. The whole revolution process will be shown by animation. How can I do this? </p>
https://ask.sagemath.org/question/45287/how-plot-revolution-of-a-circle-to-generate-a-sphere-by-animation-view/?answer=45289#post-id-45289For each step of the (discretized) revolution process you have to define a picture, and you will glue the pictures into an animation with the `animate` function. Since each picture corresponds to a range of longitudes, the easiest way to do this should be to use a representation of the sphere by it spherical coordinates, so, you can use the following:
- parametric plot 3d : https://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/parametric_plot3d.html
- spherical plot 3d : https://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/plot3d.html#sage.plot.plot3d.plot3d.spherical_plot3d
- animate : https://doc.sagemath.org/html/en/reference/plotting/sage/plot/animate.html
Sun, 03 Feb 2019 15:56:13 +0100https://ask.sagemath.org/question/45287/how-plot-revolution-of-a-circle-to-generate-a-sphere-by-animation-view/?answer=45289#post-id-45289