File:Quadrics.gif
Summary
Description |
English: Quadric surfaces are the 3D generalization of conic sections.
(Not plotting the elliptical version of the quadrics, which are obtained by stretching one or more axes) |
Date | |
Source | {https://twitter.com/j_bertolotti/status/1232302333717106689 |
Author | Jacopo Bertolotti |
Permission (Reusing this file) |
https://twitter.com/j_bertolotti/status/1030470604418428929 |
Mathematica 12.0 code
cylinder = Table[Show[ContourPlot3D[Evaluate[(x^2/1^2 + y^2/1^2 == 3^2)], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (x/y < Tan[\[Alpha]])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Cylinder", LabelStyle -> {Black, Bold}], {\[Alpha], -\[Pi]/2.01, \[Pi]/ 2.01, \[Pi]/50}]; cone = Table[Show[ContourPlot3D[Evaluate[(x^2/1^2 + y^2/1^2 - z^2/2^2 == 0)], {x, -5, 5}, {y, -5,5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (x/y < Tan[\[Alpha]])]] , PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Cone", LabelStyle -> {Black, Bold}], {\[Alpha], -\[Pi]/2.01, \[Pi]/ 2.01, \[Pi]/50}]; sphere = Table[Show[ParametricPlot3D[{x Sin[\[Alpha]], x Cos[\[Alpha]], Sqrt[4^2 - x^2]}, {x, -3, 3}, PlotStyle -> {Thick, Black}], ParametricPlot3D[{x Sin[\[Alpha]], x Cos[\[Alpha]], -Sqrt[4^2 - x^2]}, {x, -3, 3}, PlotStyle -> {Thick, Black}], ContourPlot3D[Evaluate[(x^2/1^2 + y^2/1^2 + z^2/1^2 == 4^2)], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (x/y < Tan[\[Alpha]])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Sphere", LabelStyle -> {Black, Bold}], {\[Alpha], -\[Pi]/2.01, \[Pi]/ 2.01, \[Pi]/50}]; paraboloid = Table[Show[ParametricPlot3D[{x Sin[\[Alpha]], x Cos[\[Alpha]], x^2}, {x, -3, 3}, PlotStyle -> {Thick, Black}],ContourPlot3D[Evaluate[(x^2/1^2 + y^2/1^2 - z^1/1^2 == 0)], {x, -5, 5}, {y, -5,5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (x/y < Tan[\[Alpha]])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Paraboloid", LabelStyle -> {Black, Bold}], {\[Alpha], -\[Pi]/2.01, \[Pi]/ 2.01, \[Pi]/50}]; hyperboloid1 = Table[Show[ParametricPlot3D[{x Sin[\[Alpha]], x Cos[\[Alpha]], 2 Sqrt[x^2 - 1]}, {x, -3, 3}, PlotStyle -> {Thick, Black}],ParametricPlot3D[{x Sin[\[Alpha]], x Cos[\[Alpha]], -2 Sqrt[x^2 - 1]}, {x, -3, 3}, PlotStyle -> {Thick, Black}], ContourPlot3D[Evaluate[(x^2/1^2 + y^2/1^2 - z^2/2^2 == 1)], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (x/y < Tan[\[Alpha]])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Hyperboloid of one sheet", LabelStyle -> {Black, Bold}], {\[Alpha], -\[Pi]/2.01, \[Pi]/ 2.01, \[Pi]/50}]; hyperboloid2 = Table[Show[ParametricPlot3D[{x Sin[\[Alpha]], x Cos[\[Alpha]], 2 Sqrt[1 + x^2]}, {x, -3, 3}, PlotStyle -> {Thick, Black}],ParametricPlot3D[{x Sin[\[Alpha]], x Cos[\[Alpha]], -2 Sqrt[1 + x^2]}, {x, -3, 3}, PlotStyle -> {Thick, Black}], ContourPlot3D[Evaluate[(x^2/1^2 + y^2/1^2 - z^2/2^2 == -1)], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (x/y < Tan[\[Alpha]])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Hyperboloid of two sheets", LabelStyle -> {Black, Bold}], {\[Alpha], -\[Pi]/2.01, \[Pi]/ 2.01, \[Pi]/50}]; hyperboliccylinder = Table[Show[ContourPlot3D[Evaluate[(x^2/1^2 - y^2/1^2 == 1)], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (z < \[Alpha])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Hyperbolic Cylinder", LabelStyle -> {Black, Bold}], {\[Alpha], -5.01, 5 - 0.1, 10/50}]; paraboliccylinder = Table[Show[ContourPlot3D[Evaluate[(x^2 + 2 y == 0)], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (z < \[Alpha])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Parabolic Cylinder", LabelStyle -> {Black, Bold}], {\[Alpha], -5.01, 5 - 0.1, 10/50}]; hyperbolicparaboloid = Table[Show[ContourPlot3D[Evaluate[(x^2 - y^2 - 5 z == 0)], {x, -5, 5}, {y, -5, 5}, {z, -5,5}, Mesh -> None, PlotPoints -> 60, RegionFunction -> Function[{x, y, z}, (x < \[Alpha])]], PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}, Boxed -> False, Axes -> False, PlotLabel -> "Hyperbolic Paraboloid", LabelStyle -> {Black, Bold}], {\[Alpha], -5.01, 5 - 0.1, 10/50}]; p0 = Table[Grid[{{sphere[[j]], cylinder[[j]], cone[[j]]}, {paraboloid[[j]], hyperboloid1[[j]], hyperboloid2[[j]]}, {hyperbolicparaboloid[[j]], paraboliccylinder[[j]], hyperboliccylinder[[j]]}}], {j, 1, 50}]; ListAnimate[p0]
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
![]() ![]() |
This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. |
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
|