passagemath-symbolics 10.6.37__cp314-cp314t-macosx_13_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_symbolics/.dylibs/libgmp.10.dylib +0 -0
- passagemath_symbolics/__init__.py +3 -0
- passagemath_symbolics-10.6.37.dist-info/METADATA +187 -0
- passagemath_symbolics-10.6.37.dist-info/RECORD +172 -0
- passagemath_symbolics-10.6.37.dist-info/WHEEL +6 -0
- passagemath_symbolics-10.6.37.dist-info/top_level.txt +3 -0
- sage/all__sagemath_symbolics.py +17 -0
- sage/calculus/all.py +14 -0
- sage/calculus/calculus.py +2826 -0
- sage/calculus/desolvers.py +1866 -0
- sage/calculus/predefined.py +51 -0
- sage/calculus/tests.py +225 -0
- sage/calculus/var.cpython-314t-darwin.so +0 -0
- sage/calculus/var.pyx +401 -0
- sage/dynamics/all__sagemath_symbolics.py +6 -0
- sage/dynamics/complex_dynamics/all.py +5 -0
- sage/dynamics/complex_dynamics/mandel_julia.py +765 -0
- sage/dynamics/complex_dynamics/mandel_julia_helper.cpython-314t-darwin.so +0 -0
- sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +1035 -0
- sage/ext/all__sagemath_symbolics.py +1 -0
- sage/ext_data/kenzo/CP2.txt +45 -0
- sage/ext_data/kenzo/CP3.txt +349 -0
- sage/ext_data/kenzo/CP4.txt +4774 -0
- sage/ext_data/kenzo/README.txt +49 -0
- sage/ext_data/kenzo/S4.txt +20 -0
- sage/ext_data/magma/latex/latex.m +1021 -0
- sage/ext_data/magma/latex/latex.spec +1 -0
- sage/ext_data/magma/sage/basic.m +356 -0
- sage/ext_data/magma/sage/sage.spec +1 -0
- sage/ext_data/magma/spec +9 -0
- sage/geometry/all__sagemath_symbolics.py +8 -0
- sage/geometry/hyperbolic_space/all.py +5 -0
- sage/geometry/hyperbolic_space/hyperbolic_coercion.py +743 -0
- sage/geometry/hyperbolic_space/hyperbolic_constants.py +5 -0
- sage/geometry/hyperbolic_space/hyperbolic_geodesic.py +2409 -0
- sage/geometry/hyperbolic_space/hyperbolic_interface.py +206 -0
- sage/geometry/hyperbolic_space/hyperbolic_isometry.py +1082 -0
- sage/geometry/hyperbolic_space/hyperbolic_model.py +1502 -0
- sage/geometry/hyperbolic_space/hyperbolic_point.py +621 -0
- sage/geometry/riemannian_manifolds/all.py +7 -0
- sage/geometry/riemannian_manifolds/parametrized_surface3d.py +1632 -0
- sage/geometry/riemannian_manifolds/surface3d_generators.py +461 -0
- sage/interfaces/all__sagemath_symbolics.py +1 -0
- sage/interfaces/magma.py +3017 -0
- sage/interfaces/magma_free.py +92 -0
- sage/interfaces/maple.py +1397 -0
- sage/interfaces/mathematica.py +1345 -0
- sage/interfaces/mathics.py +1312 -0
- sage/interfaces/sympy.py +1398 -0
- sage/interfaces/sympy_wrapper.py +197 -0
- sage/interfaces/tides.py +938 -0
- sage/libs/all__sagemath_symbolics.py +6 -0
- sage/manifolds/all.py +7 -0
- sage/manifolds/calculus_method.py +555 -0
- sage/manifolds/catalog.py +437 -0
- sage/manifolds/chart.py +4019 -0
- sage/manifolds/chart_func.py +3419 -0
- sage/manifolds/continuous_map.py +2183 -0
- sage/manifolds/continuous_map_image.py +155 -0
- sage/manifolds/differentiable/affine_connection.py +2475 -0
- sage/manifolds/differentiable/all.py +1 -0
- sage/manifolds/differentiable/automorphismfield.py +1383 -0
- sage/manifolds/differentiable/automorphismfield_group.py +604 -0
- sage/manifolds/differentiable/bundle_connection.py +1445 -0
- sage/manifolds/differentiable/characteristic_cohomology_class.py +1840 -0
- sage/manifolds/differentiable/chart.py +1241 -0
- sage/manifolds/differentiable/curve.py +1028 -0
- sage/manifolds/differentiable/de_rham_cohomology.py +541 -0
- sage/manifolds/differentiable/degenerate.py +559 -0
- sage/manifolds/differentiable/degenerate_submanifold.py +1671 -0
- sage/manifolds/differentiable/diff_form.py +1658 -0
- sage/manifolds/differentiable/diff_form_module.py +1062 -0
- sage/manifolds/differentiable/diff_map.py +1315 -0
- sage/manifolds/differentiable/differentiable_submanifold.py +291 -0
- sage/manifolds/differentiable/examples/all.py +1 -0
- sage/manifolds/differentiable/examples/euclidean.py +2517 -0
- sage/manifolds/differentiable/examples/real_line.py +897 -0
- sage/manifolds/differentiable/examples/sphere.py +1186 -0
- sage/manifolds/differentiable/examples/symplectic_space.py +187 -0
- sage/manifolds/differentiable/examples/symplectic_space_test.py +40 -0
- sage/manifolds/differentiable/integrated_curve.py +4035 -0
- sage/manifolds/differentiable/levi_civita_connection.py +841 -0
- sage/manifolds/differentiable/manifold.py +4254 -0
- sage/manifolds/differentiable/manifold_homset.py +1826 -0
- sage/manifolds/differentiable/metric.py +3032 -0
- sage/manifolds/differentiable/mixed_form.py +1507 -0
- sage/manifolds/differentiable/mixed_form_algebra.py +559 -0
- sage/manifolds/differentiable/multivector_module.py +800 -0
- sage/manifolds/differentiable/multivectorfield.py +1520 -0
- sage/manifolds/differentiable/poisson_tensor.py +268 -0
- sage/manifolds/differentiable/pseudo_riemannian.py +755 -0
- sage/manifolds/differentiable/pseudo_riemannian_submanifold.py +1839 -0
- sage/manifolds/differentiable/scalarfield.py +1343 -0
- sage/manifolds/differentiable/scalarfield_algebra.py +472 -0
- sage/manifolds/differentiable/symplectic_form.py +910 -0
- sage/manifolds/differentiable/symplectic_form_test.py +220 -0
- sage/manifolds/differentiable/tangent_space.py +412 -0
- sage/manifolds/differentiable/tangent_vector.py +616 -0
- sage/manifolds/differentiable/tensorfield.py +4665 -0
- sage/manifolds/differentiable/tensorfield_module.py +963 -0
- sage/manifolds/differentiable/tensorfield_paral.py +2450 -0
- sage/manifolds/differentiable/tensorfield_paral_test.py +16 -0
- sage/manifolds/differentiable/vector_bundle.py +1728 -0
- sage/manifolds/differentiable/vectorfield.py +1717 -0
- sage/manifolds/differentiable/vectorfield_module.py +2445 -0
- sage/manifolds/differentiable/vectorframe.py +1832 -0
- sage/manifolds/family.py +270 -0
- sage/manifolds/local_frame.py +1490 -0
- sage/manifolds/manifold.py +3090 -0
- sage/manifolds/manifold_homset.py +452 -0
- sage/manifolds/operators.py +359 -0
- sage/manifolds/point.py +994 -0
- sage/manifolds/scalarfield.py +3718 -0
- sage/manifolds/scalarfield_algebra.py +629 -0
- sage/manifolds/section.py +3111 -0
- sage/manifolds/section_module.py +831 -0
- sage/manifolds/structure.py +229 -0
- sage/manifolds/subset.py +2764 -0
- sage/manifolds/subsets/all.py +1 -0
- sage/manifolds/subsets/closure.py +131 -0
- sage/manifolds/subsets/pullback.py +885 -0
- sage/manifolds/topological_submanifold.py +891 -0
- sage/manifolds/trivialization.py +733 -0
- sage/manifolds/utilities.py +1348 -0
- sage/manifolds/vector_bundle.py +1342 -0
- sage/manifolds/vector_bundle_fiber.py +332 -0
- sage/manifolds/vector_bundle_fiber_element.py +111 -0
- sage/matrix/all__sagemath_symbolics.py +1 -0
- sage/matrix/matrix_symbolic_dense.cpython-314t-darwin.so +0 -0
- sage/matrix/matrix_symbolic_dense.pxd +6 -0
- sage/matrix/matrix_symbolic_dense.pyx +1022 -0
- sage/matrix/matrix_symbolic_sparse.cpython-314t-darwin.so +0 -0
- sage/matrix/matrix_symbolic_sparse.pxd +6 -0
- sage/matrix/matrix_symbolic_sparse.pyx +1029 -0
- sage/modules/all__sagemath_symbolics.py +1 -0
- sage/modules/vector_callable_symbolic_dense.py +105 -0
- sage/modules/vector_symbolic_dense.py +116 -0
- sage/modules/vector_symbolic_sparse.py +118 -0
- sage/rings/all__sagemath_symbolics.py +4 -0
- sage/rings/asymptotic/all.py +6 -0
- sage/rings/asymptotic/asymptotic_expansion_generators.py +1485 -0
- sage/rings/asymptotic/asymptotic_ring.py +4858 -0
- sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +4153 -0
- sage/rings/asymptotic/growth_group.py +5373 -0
- sage/rings/asymptotic/growth_group_cartesian.py +1400 -0
- sage/rings/asymptotic/term_monoid.py +5237 -0
- sage/rings/function_field/all__sagemath_symbolics.py +2 -0
- sage/rings/polynomial/all__sagemath_symbolics.py +1 -0
- sage/symbolic/all.py +15 -0
- sage/symbolic/assumptions.py +985 -0
- sage/symbolic/benchmark.py +93 -0
- sage/symbolic/callable.py +459 -0
- sage/symbolic/complexity_measures.py +35 -0
- sage/symbolic/constants.py +1287 -0
- sage/symbolic/expression_conversion_algebraic.py +310 -0
- sage/symbolic/expression_conversion_sympy.py +317 -0
- sage/symbolic/expression_conversions.py +1713 -0
- sage/symbolic/function_factory.py +355 -0
- sage/symbolic/integration/all.py +1 -0
- sage/symbolic/integration/external.py +270 -0
- sage/symbolic/integration/integral.py +1115 -0
- sage/symbolic/maxima_wrapper.py +162 -0
- sage/symbolic/operators.py +267 -0
- sage/symbolic/random_tests.py +462 -0
- sage/symbolic/relation.py +1907 -0
- sage/symbolic/ring.cpython-314t-darwin.so +0 -0
- sage/symbolic/ring.pxd +5 -0
- sage/symbolic/ring.pyx +1396 -0
- sage/symbolic/subring.py +1025 -0
- sage/symbolic/symengine.py +19 -0
- sage/symbolic/tests.py +40 -0
- sage/symbolic/units.py +1470 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-symbolics
|
|
2
|
+
r"""
|
|
3
|
+
Common parametrized surfaces in 3D.
|
|
4
|
+
|
|
5
|
+
AUTHORS::
|
|
6
|
+
|
|
7
|
+
- Joris Vankerschaver (2012-06-16)
|
|
8
|
+
"""
|
|
9
|
+
#*****************************************************************************
|
|
10
|
+
# Copyright (C) 2010 Joris Vankerschaver <joris.vankerschaver@gmail.com>
|
|
11
|
+
#
|
|
12
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
13
|
+
# http://www.gnu.org/licenses/
|
|
14
|
+
#*****************************************************************************
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
from sage.symbolic.constants import pi
|
|
18
|
+
from sage.functions.log import log
|
|
19
|
+
from sage.functions.trig import sin, cos, tan
|
|
20
|
+
from sage.functions.hyperbolic import cosh, tanh
|
|
21
|
+
from sage.symbolic.ring import var
|
|
22
|
+
from sage.geometry.riemannian_manifolds.parametrized_surface3d import \
|
|
23
|
+
ParametrizedSurface3D
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class SurfaceGenerators:
|
|
27
|
+
"""
|
|
28
|
+
A class consisting of generators for several common parametrized surfaces
|
|
29
|
+
in 3D.
|
|
30
|
+
"""
|
|
31
|
+
@staticmethod
|
|
32
|
+
def Catenoid(c=1, name='Catenoid'):
|
|
33
|
+
r"""
|
|
34
|
+
Return a catenoid surface, with parametric representation.
|
|
35
|
+
|
|
36
|
+
.. MATH::
|
|
37
|
+
|
|
38
|
+
\begin{aligned}
|
|
39
|
+
x(u, v) & = c \cosh(v/c) \cos(u); \\
|
|
40
|
+
y(u, v) & = c \cosh(v/c) \sin(u); \\
|
|
41
|
+
z(u, v) & = v.
|
|
42
|
+
\end{aligned}
|
|
43
|
+
|
|
44
|
+
INPUT:
|
|
45
|
+
|
|
46
|
+
- ``c`` -- surface parameter
|
|
47
|
+
|
|
48
|
+
- ``name`` -- string; name of the surface
|
|
49
|
+
|
|
50
|
+
For more information, see :wikipedia:`Catenoid`.
|
|
51
|
+
|
|
52
|
+
EXAMPLES::
|
|
53
|
+
|
|
54
|
+
sage: cat = surfaces.Catenoid(); cat
|
|
55
|
+
Parametrized surface ('Catenoid') with equation (cos(u)*cosh(v), cosh(v)*sin(u), v)
|
|
56
|
+
sage: cat.plot() # needs sage.plot
|
|
57
|
+
Graphics3d Object
|
|
58
|
+
"""
|
|
59
|
+
u, v = var('u, v')
|
|
60
|
+
catenoid_eq = [c*cosh(v/c)*cos(u), c*cosh(v/c)*sin(u), v]
|
|
61
|
+
coords = ((u, 0, 2 * pi), (v, -1, 1))
|
|
62
|
+
return ParametrizedSurface3D(catenoid_eq, coords, name)
|
|
63
|
+
|
|
64
|
+
@staticmethod
|
|
65
|
+
def Crosscap(r=1, name='Crosscap'):
|
|
66
|
+
r"""
|
|
67
|
+
Return a crosscap surface, with parametrization.
|
|
68
|
+
|
|
69
|
+
.. MATH::
|
|
70
|
+
|
|
71
|
+
\begin{aligned}
|
|
72
|
+
x(u, v) & = r(1 + \cos(v)) \cos(u); \\
|
|
73
|
+
y(u, v) & = r(1 + \cos(v)) \sin(u); \\
|
|
74
|
+
z(u, v) & = - r\tanh(u - \pi) \sin(v).
|
|
75
|
+
\end{aligned}
|
|
76
|
+
|
|
77
|
+
INPUT:
|
|
78
|
+
|
|
79
|
+
- ``r`` -- surface parameter
|
|
80
|
+
|
|
81
|
+
- ``name`` -- string; name of the surface
|
|
82
|
+
|
|
83
|
+
For more information, see :wikipedia:`Cross-cap`.
|
|
84
|
+
|
|
85
|
+
EXAMPLES::
|
|
86
|
+
|
|
87
|
+
sage: crosscap = surfaces.Crosscap(); crosscap
|
|
88
|
+
Parametrized surface ('Crosscap') with equation ((cos(v) + 1)*cos(u), (cos(v) + 1)*sin(u), -sin(v)*tanh(-pi + u))
|
|
89
|
+
sage: crosscap.plot() # needs sage.plot
|
|
90
|
+
Graphics3d Object
|
|
91
|
+
"""
|
|
92
|
+
u, v = var('u, v')
|
|
93
|
+
crosscap_eq = [r*(1+cos(v))*cos(u), r*(1+cos(v))*sin(u),
|
|
94
|
+
-tanh(u-pi)*r*sin(v)]
|
|
95
|
+
coords = ((u, 0, 2 * pi), (v, 0, 2 * pi))
|
|
96
|
+
return ParametrizedSurface3D(crosscap_eq, coords, name)
|
|
97
|
+
|
|
98
|
+
@staticmethod
|
|
99
|
+
def Dini(a=1, b=1, name="Dini's surface"):
|
|
100
|
+
r"""
|
|
101
|
+
Return Dini's surface, with parametrization.
|
|
102
|
+
|
|
103
|
+
.. MATH::
|
|
104
|
+
|
|
105
|
+
\begin{aligned}
|
|
106
|
+
x(u, v) & = a \cos(u)\sin(v); \\
|
|
107
|
+
y(u, v) & = a \sin(u)\sin(v); \\
|
|
108
|
+
z(u, v) & = u + \log(\tan(v/2)) + \cos(v).
|
|
109
|
+
\end{aligned}
|
|
110
|
+
|
|
111
|
+
INPUT:
|
|
112
|
+
|
|
113
|
+
- ``a``, ``b`` -- surface parameters
|
|
114
|
+
|
|
115
|
+
- ``name`` -- string; name of the surface
|
|
116
|
+
|
|
117
|
+
For more information, see :wikipedia:`Dini%27s_surface`.
|
|
118
|
+
|
|
119
|
+
EXAMPLES::
|
|
120
|
+
|
|
121
|
+
sage: dini = surfaces.Dini(a=3, b=4); dini
|
|
122
|
+
Parametrized surface ('Dini's surface') with equation (3*cos(u)*sin(v), 3*sin(u)*sin(v), 4*u + 3*cos(v) + 3*log(tan(1/2*v)))
|
|
123
|
+
sage: dini.plot() # needs sage.plot
|
|
124
|
+
Graphics3d Object
|
|
125
|
+
"""
|
|
126
|
+
u, v = var('u, v')
|
|
127
|
+
dini_eq = [a*cos(u)*sin(v), a*sin(u)*sin(v),
|
|
128
|
+
a*(cos(v) + log(tan(v/2))) + b*u]
|
|
129
|
+
coords = ((u, 0, 2 * pi), (v, 0, 2 * pi))
|
|
130
|
+
return ParametrizedSurface3D(dini_eq, coords, name)
|
|
131
|
+
|
|
132
|
+
@staticmethod
|
|
133
|
+
def Ellipsoid(center=(0, 0, 0), axes=(1, 1, 1), name='Ellipsoid'):
|
|
134
|
+
r"""
|
|
135
|
+
Return an ellipsoid centered at ``center`` whose semi-principal axes
|
|
136
|
+
have lengths given by the components of ``axes``. The
|
|
137
|
+
parametrization of the ellipsoid is given by
|
|
138
|
+
|
|
139
|
+
.. MATH::
|
|
140
|
+
|
|
141
|
+
\begin{aligned}
|
|
142
|
+
x(u, v) & = x_0 + a \cos(u) \cos(v); \\
|
|
143
|
+
y(u, v) & = y_0 + b \sin(u) \cos(v); \\
|
|
144
|
+
z(u, v) & = z_0 + c \sin(v).
|
|
145
|
+
\end{aligned}
|
|
146
|
+
|
|
147
|
+
INPUT:
|
|
148
|
+
|
|
149
|
+
- ``center`` -- 3-tuple; coordinates of the center of the ellipsoid
|
|
150
|
+
|
|
151
|
+
- ``axes`` -- 3-tuple; lengths of the semi-principal axes
|
|
152
|
+
|
|
153
|
+
- ``name`` -- string; name of the ellipsoid
|
|
154
|
+
|
|
155
|
+
For more information, see :wikipedia:`Ellipsoid`.
|
|
156
|
+
|
|
157
|
+
EXAMPLES::
|
|
158
|
+
|
|
159
|
+
sage: ell = surfaces.Ellipsoid(axes=(1, 2, 3)); ell
|
|
160
|
+
Parametrized surface ('Ellipsoid') with equation (cos(u)*cos(v), 2*cos(v)*sin(u), 3*sin(v))
|
|
161
|
+
sage: ell.plot() # needs sage.plot
|
|
162
|
+
Graphics3d Object
|
|
163
|
+
"""
|
|
164
|
+
u, v = var('u, v')
|
|
165
|
+
x, y, z = center
|
|
166
|
+
a, b, c = axes
|
|
167
|
+
ellipsoid_parametric_eq = [x + a*cos(u)*cos(v),
|
|
168
|
+
y + b*sin(u)*cos(v),
|
|
169
|
+
z + c*sin(v)]
|
|
170
|
+
coords = ((u, 0, 2 * pi), (v, -pi / 2, pi / 2))
|
|
171
|
+
return ParametrizedSurface3D(ellipsoid_parametric_eq, coords, name)
|
|
172
|
+
|
|
173
|
+
@staticmethod
|
|
174
|
+
def Enneper(name="Enneper's surface"):
|
|
175
|
+
r"""
|
|
176
|
+
Return Enneper's surface, with parametrization.
|
|
177
|
+
|
|
178
|
+
.. MATH::
|
|
179
|
+
|
|
180
|
+
\begin{aligned}
|
|
181
|
+
x(u, v) & = u(1 - u^2/3 + v^2)/3; \\
|
|
182
|
+
y(u, v) & = -v(1 - v^2/3 + u^2)/3; \\
|
|
183
|
+
z(u, v) & = (u^2 - v^2)/3.
|
|
184
|
+
\end{aligned}
|
|
185
|
+
|
|
186
|
+
INPUT:
|
|
187
|
+
|
|
188
|
+
- ``name`` -- string; name of the surface
|
|
189
|
+
|
|
190
|
+
For more information, see :wikipedia:`Enneper_surface`.
|
|
191
|
+
|
|
192
|
+
EXAMPLES::
|
|
193
|
+
|
|
194
|
+
sage: enn = surfaces.Enneper(); enn
|
|
195
|
+
Parametrized surface ('Enneper's surface') with equation (-1/9*(u^2 - 3*v^2 - 3)*u, -1/9*(3*u^2 - v^2 + 3)*v, 1/3*u^2 - 1/3*v^2)
|
|
196
|
+
sage: enn.plot() # needs sage.plot
|
|
197
|
+
Graphics3d Object
|
|
198
|
+
"""
|
|
199
|
+
u, v = var('u, v')
|
|
200
|
+
enneper_eq = [u*(1-u**2/3+v**2)/3, -v*(1-v**2/3+u**2)/3, (u**2-v**2)/3]
|
|
201
|
+
coords = ((u, -3, 3), (v, -3, 3))
|
|
202
|
+
return ParametrizedSurface3D(enneper_eq, coords, name)
|
|
203
|
+
|
|
204
|
+
@staticmethod
|
|
205
|
+
def Helicoid(h=1, name='Helicoid'):
|
|
206
|
+
r"""
|
|
207
|
+
Return a helicoid surface, with parametrization.
|
|
208
|
+
|
|
209
|
+
.. MATH::
|
|
210
|
+
|
|
211
|
+
\begin{aligned}
|
|
212
|
+
x(\rho, \theta) & = \rho \cos(\theta); \\
|
|
213
|
+
y(\rho, \theta) & = \rho \sin(\theta); \\
|
|
214
|
+
z(\rho, \theta) & = h\theta/(2\pi).
|
|
215
|
+
\end{aligned}
|
|
216
|
+
|
|
217
|
+
INPUT:
|
|
218
|
+
|
|
219
|
+
- ``h`` -- distance along the z-axis between two
|
|
220
|
+
successive turns of the helicoid
|
|
221
|
+
|
|
222
|
+
- ``name`` -- string; name of the surface
|
|
223
|
+
|
|
224
|
+
For more information, see :wikipedia:`Helicoid`.
|
|
225
|
+
|
|
226
|
+
EXAMPLES::
|
|
227
|
+
|
|
228
|
+
sage: helicoid = surfaces.Helicoid(h=2); helicoid
|
|
229
|
+
Parametrized surface ('Helicoid') with equation (rho*cos(theta), rho*sin(theta), theta/pi)
|
|
230
|
+
sage: helicoid.plot() # needs sage.plot
|
|
231
|
+
Graphics3d Object
|
|
232
|
+
"""
|
|
233
|
+
rho, theta = var('rho, theta')
|
|
234
|
+
helicoid_eq = [rho*cos(theta), rho*sin(theta), h*theta/(2*pi)]
|
|
235
|
+
coords = ((rho, -2, 2), (theta, 0, 2 * pi))
|
|
236
|
+
return ParametrizedSurface3D(helicoid_eq, coords, name)
|
|
237
|
+
|
|
238
|
+
@staticmethod
|
|
239
|
+
def Klein(r=1, name="Klein bottle"):
|
|
240
|
+
r"""
|
|
241
|
+
Return the Klein bottle, in the figure-8 parametrization given by
|
|
242
|
+
|
|
243
|
+
.. MATH::
|
|
244
|
+
|
|
245
|
+
\begin{aligned}
|
|
246
|
+
x(u, v) & = (r + \cos(u/2)\cos(v) - \sin(u/2)\sin(2v)) \cos(u); \\
|
|
247
|
+
y(u, v) & = (r + \cos(u/2)\cos(v) - \sin(u/2)\sin(2v)) \sin(u); \\
|
|
248
|
+
z(u, v) & = \sin(u/2)\cos(v) + \cos(u/2)\sin(2v).
|
|
249
|
+
\end{aligned}
|
|
250
|
+
|
|
251
|
+
INPUT:
|
|
252
|
+
|
|
253
|
+
- ``r`` -- radius of the "figure-8" circle
|
|
254
|
+
|
|
255
|
+
- ``name`` -- string; name of the surface
|
|
256
|
+
|
|
257
|
+
For more information, see :wikipedia:`Klein_bottle`.
|
|
258
|
+
|
|
259
|
+
EXAMPLES::
|
|
260
|
+
|
|
261
|
+
sage: klein = surfaces.Klein(); klein
|
|
262
|
+
Parametrized surface ('Klein bottle') with equation (-(sin(1/2*u)*sin(2*v) - cos(1/2*u)*sin(v) - 1)*cos(u), -(sin(1/2*u)*sin(2*v) - cos(1/2*u)*sin(v) - 1)*sin(u), cos(1/2*u)*sin(2*v) + sin(1/2*u)*sin(v))
|
|
263
|
+
sage: klein.plot() # needs sage.plot
|
|
264
|
+
Graphics3d Object
|
|
265
|
+
"""
|
|
266
|
+
u, v = var('u, v')
|
|
267
|
+
x = (r + cos(u/2)*sin(v) - sin(u/2)*sin(2*v))*cos(u)
|
|
268
|
+
y = (r + cos(u/2)*sin(v) - sin(u/2)*sin(2*v))*sin(u)
|
|
269
|
+
z = sin(u/2)*sin(v) + cos(u/2)*sin(2*v)
|
|
270
|
+
klein_eq = [x, y, z]
|
|
271
|
+
coords = ((u, 0, 2 * pi), (v, 0, 2 * pi))
|
|
272
|
+
|
|
273
|
+
return ParametrizedSurface3D(klein_eq, coords, name)
|
|
274
|
+
|
|
275
|
+
@staticmethod
|
|
276
|
+
def MonkeySaddle(name="Monkey saddle"):
|
|
277
|
+
r"""
|
|
278
|
+
Return a monkey saddle surface, with equation
|
|
279
|
+
|
|
280
|
+
.. MATH::
|
|
281
|
+
|
|
282
|
+
z = x^3 - 3xy^2.
|
|
283
|
+
|
|
284
|
+
INPUT:
|
|
285
|
+
|
|
286
|
+
- ``name`` -- string; name of the surface
|
|
287
|
+
|
|
288
|
+
For more information, see :wikipedia:`Monkey_saddle`.
|
|
289
|
+
|
|
290
|
+
EXAMPLES::
|
|
291
|
+
|
|
292
|
+
sage: saddle = surfaces.MonkeySaddle(); saddle
|
|
293
|
+
Parametrized surface ('Monkey saddle') with equation (u, v, u^3 - 3*u*v^2)
|
|
294
|
+
sage: saddle.plot() # needs sage.plot
|
|
295
|
+
Graphics3d Object
|
|
296
|
+
"""
|
|
297
|
+
u, v = var('u, v')
|
|
298
|
+
monkey_eq = [u, v, u**3 - 3*u*v**2]
|
|
299
|
+
coords = ((u, -2, 2), (v, -2, 2))
|
|
300
|
+
|
|
301
|
+
return ParametrizedSurface3D(monkey_eq, coords, name)
|
|
302
|
+
|
|
303
|
+
@staticmethod
|
|
304
|
+
def Paraboloid(a=1, b=1, c=1, elliptic=True, name=None):
|
|
305
|
+
r"""
|
|
306
|
+
Return a paraboloid with equation.
|
|
307
|
+
|
|
308
|
+
.. MATH::
|
|
309
|
+
|
|
310
|
+
\frac{z}{c} = \pm \frac{x^2}{a^2} + \frac{y^2}{b^2}
|
|
311
|
+
|
|
312
|
+
When the plus sign is selected, the paraboloid is elliptic. Otherwise
|
|
313
|
+
the surface is a hyperbolic paraboloid.
|
|
314
|
+
|
|
315
|
+
INPUT:
|
|
316
|
+
|
|
317
|
+
- ``a``, ``b``, ``c`` -- surface parameters
|
|
318
|
+
|
|
319
|
+
- ``elliptic`` -- boolean (default: ``True``); whether to create an
|
|
320
|
+
elliptic or hyperbolic paraboloid
|
|
321
|
+
|
|
322
|
+
- ``name`` -- string; name of the surface
|
|
323
|
+
|
|
324
|
+
For more information, see :wikipedia:`Paraboloid`.
|
|
325
|
+
|
|
326
|
+
EXAMPLES::
|
|
327
|
+
|
|
328
|
+
sage: epar = surfaces.Paraboloid(1, 3, 2); epar
|
|
329
|
+
Parametrized surface ('Elliptic paraboloid') with equation (u, v, 2*u^2 + 2/9*v^2)
|
|
330
|
+
sage: epar.plot() # needs sage.plot
|
|
331
|
+
Graphics3d Object
|
|
332
|
+
|
|
333
|
+
sage: hpar = surfaces.Paraboloid(2, 3, 1, elliptic=False); hpar
|
|
334
|
+
Parametrized surface ('Hyperbolic paraboloid') with equation (u, v, -1/4*u^2 + 1/9*v^2)
|
|
335
|
+
sage: hpar.plot() # needs sage.plot
|
|
336
|
+
Graphics3d Object
|
|
337
|
+
"""
|
|
338
|
+
u, v = var('u, v')
|
|
339
|
+
x = u
|
|
340
|
+
y = v
|
|
341
|
+
if elliptic:
|
|
342
|
+
z = c*(v**2/b**2 + u**2/a**2)
|
|
343
|
+
else:
|
|
344
|
+
z = c*(v**2/b**2 - u**2/a**2)
|
|
345
|
+
paraboloid_eq = [x, y, z]
|
|
346
|
+
coords = ((u, -3, 3), (v, -3, 3))
|
|
347
|
+
|
|
348
|
+
if name is None:
|
|
349
|
+
if elliptic:
|
|
350
|
+
name = "Elliptic paraboloid"
|
|
351
|
+
else:
|
|
352
|
+
name = "Hyperbolic paraboloid"
|
|
353
|
+
|
|
354
|
+
return ParametrizedSurface3D(paraboloid_eq, coords, name)
|
|
355
|
+
|
|
356
|
+
@staticmethod
|
|
357
|
+
def Sphere(center=(0, 0, 0), R=1, name='Sphere'):
|
|
358
|
+
r"""
|
|
359
|
+
Return a sphere of radius ``R`` centered at ``center``.
|
|
360
|
+
|
|
361
|
+
INPUT:
|
|
362
|
+
|
|
363
|
+
- ``center`` -- 3-tuple; center of the sphere
|
|
364
|
+
|
|
365
|
+
- ``R`` -- radius of the sphere
|
|
366
|
+
|
|
367
|
+
- ``name`` -- string; name of the surface
|
|
368
|
+
|
|
369
|
+
For more information, see :wikipedia:`Sphere`.
|
|
370
|
+
|
|
371
|
+
EXAMPLES::
|
|
372
|
+
|
|
373
|
+
sage: sphere = surfaces.Sphere(center=(0, 1, -1), R=2); sphere
|
|
374
|
+
Parametrized surface ('Sphere') with equation (2*cos(u)*cos(v), 2*cos(v)*sin(u) + 1, 2*sin(v) - 1)
|
|
375
|
+
sage: sphere.plot() # needs sage.plot
|
|
376
|
+
Graphics3d Object
|
|
377
|
+
|
|
378
|
+
Note that the radius of the sphere can be negative. The surface thus
|
|
379
|
+
obtained is equal to the sphere (or part thereof) with positive radius,
|
|
380
|
+
whose coordinate functions have been multiplied by -1. Compare for
|
|
381
|
+
instant the first octant of the unit sphere with positive radius::
|
|
382
|
+
|
|
383
|
+
sage: octant1 = surfaces.Sphere(R=1); octant1
|
|
384
|
+
Parametrized surface ('Sphere') with equation (cos(u)*cos(v), cos(v)*sin(u), sin(v))
|
|
385
|
+
sage: octant1.plot((0, pi/2), (0, pi/2)) # needs sage.plot
|
|
386
|
+
Graphics3d Object
|
|
387
|
+
|
|
388
|
+
with the first octant of the unit sphere with negative radius::
|
|
389
|
+
|
|
390
|
+
sage: octant2 = surfaces.Sphere(R=-1); octant2
|
|
391
|
+
Parametrized surface ('Sphere') with equation (-cos(u)*cos(v), -cos(v)*sin(u), -sin(v))
|
|
392
|
+
sage: octant2.plot((0, pi/2), (0, pi/2)) # needs sage.plot
|
|
393
|
+
Graphics3d Object
|
|
394
|
+
"""
|
|
395
|
+
return SurfaceGenerators.Ellipsoid(center, (R, R, R), name)
|
|
396
|
+
|
|
397
|
+
@staticmethod
|
|
398
|
+
def Torus(r=2, R=3, name='Torus'):
|
|
399
|
+
r"""
|
|
400
|
+
Return a torus obtained by revolving a circle of radius ``r`` around
|
|
401
|
+
a coplanar axis ``R`` units away from the center of the circle. The
|
|
402
|
+
parametrization used is
|
|
403
|
+
|
|
404
|
+
.. MATH::
|
|
405
|
+
|
|
406
|
+
\begin{aligned}
|
|
407
|
+
x(u, v) & = (R + r \cos(v)) \cos(u); \\
|
|
408
|
+
y(u, v) & = (R + r \cos(v)) \sin(u); \\
|
|
409
|
+
z(u, v) & = r \sin(v).
|
|
410
|
+
\end{aligned}
|
|
411
|
+
|
|
412
|
+
INPUT:
|
|
413
|
+
|
|
414
|
+
- ``r``, ``R`` -- minor and major radius of the torus
|
|
415
|
+
|
|
416
|
+
- ``name`` -- string; name of the surface
|
|
417
|
+
|
|
418
|
+
For more information, see :wikipedia:`Torus`.
|
|
419
|
+
|
|
420
|
+
EXAMPLES::
|
|
421
|
+
|
|
422
|
+
sage: torus = surfaces.Torus(); torus
|
|
423
|
+
Parametrized surface ('Torus') with equation ((2*cos(v) + 3)*cos(u), (2*cos(v) + 3)*sin(u), 2*sin(v))
|
|
424
|
+
sage: torus.plot() # needs sage.plot
|
|
425
|
+
Graphics3d Object
|
|
426
|
+
"""
|
|
427
|
+
u, v = var('u, v')
|
|
428
|
+
torus_eq = [(R+r*cos(v))*cos(u), (R+r*cos(v))*sin(u), r*sin(v)]
|
|
429
|
+
coords = ((u, 0, 2 * pi), (v, 0, 2 * pi))
|
|
430
|
+
return ParametrizedSurface3D(torus_eq, coords, name)
|
|
431
|
+
|
|
432
|
+
@staticmethod
|
|
433
|
+
def WhitneyUmbrella(name="Whitney's umbrella"):
|
|
434
|
+
r"""
|
|
435
|
+
Return Whitney's umbrella, with parametric representation
|
|
436
|
+
|
|
437
|
+
.. MATH::
|
|
438
|
+
|
|
439
|
+
x(u, v) = uv, \quad y(u, v) = u, \quad z(u, v) = v^2.
|
|
440
|
+
|
|
441
|
+
INPUT:
|
|
442
|
+
|
|
443
|
+
- ``name`` -- string; name of the surface
|
|
444
|
+
|
|
445
|
+
For more information, see :wikipedia:`Whitney_umbrella`.
|
|
446
|
+
|
|
447
|
+
EXAMPLES::
|
|
448
|
+
|
|
449
|
+
sage: whitney = surfaces.WhitneyUmbrella(); whitney
|
|
450
|
+
Parametrized surface ('Whitney's umbrella') with equation (u*v, u, v^2)
|
|
451
|
+
sage: whitney.plot() # needs sage.plot
|
|
452
|
+
Graphics3d Object
|
|
453
|
+
"""
|
|
454
|
+
u, v = var('u, v')
|
|
455
|
+
whitney_eq = [u*v, u, v**2]
|
|
456
|
+
coords = ((u, -1, 1), (v, -1, 1))
|
|
457
|
+
return ParametrizedSurface3D(whitney_eq, coords, name)
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
# Easy access to the surface generators
|
|
461
|
+
surfaces = SurfaceGenerators()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-symbolics
|