#10132: Parametrization of (metric) surfaces in 3D euclidean space
---------------------------------------------------------------+------------
Reporter: mikarm | Owner:
mikarm
Type: enhancement | Status:
needs_work
Priority: major | Milestone:
sage-5.11
Component: geometry | Resolution:
Keywords: differential geometry, parametrized surface | Work issues:
Report Upstream: N/A | Reviewers:
vdelecroix
Authors: Mikhail Malakhaltsev, Joris Vankerschaver | Merged in:
Dependencies: #11549 | Stopgaps:
---------------------------------------------------------------+------------
Changes (by vdelecroix):
* status: needs_review => needs_work
Comment:
Hello,
I hope we will have this patch soonly integrated into Sage.
0) The patch does not apply anymore on sage-5.11.beta3 because conf.py for
the documentation has been modified (the list is now automatically built).
You can simply remove your modifications to that file. But your file is
still not linked in the reference manual, modify the file
'doc/en/reference/geometry/index.rst' accordingly.
1) Many tests fail on my computer because of the random (?) order of terms
in a symbolic expression. Here is an example
{{{
File "parametrized_surface3d.py", line 79, in
sage.geometry.riemannian_manifolds.parametrized_surface3d.ParametrizedSurface3D
Failed example:
ellipsoid = ParametrizedSurface3D(ellipsoid_eq, coords, 'ellipsoid');
ellipsoid
Expected:
Parametrized surface ('ellipsoid') with equation (cos(u1)*cos(u2),
2*sin(u1)*cos(u2), 3*sin(u2))
Got:
Parametrized surface ('ellipsoid') with equation (cos(u1)*cos(u2),
2*cos(u2)*sin(u1), 3*sin(u2))
}}}
2) in all.py instead of using `import` you should use `lazy_import` as
follows
{{{
from sage.misc.lazy_import import lazy_import
lazy_import('sage.geometry.riemannian_manifolds.parametrized_surface3d',
'ParametrizedSurface3D')
lazy_import('sage.geometry.riemannian_manifolds.surface3d_generators',
'surfaces')
}}}
The advantage is that it does not affect Sage startup time.
3) You use the old framework for errors (which will not be compatible with
Python 3), just replace
{{{
raise ValueError, "my error message"
}}}
by
{{{
raise ValueError("my error message")
}}}
4) In the surface generator, because `self` is never invoked in the core
of the method it is better to use the decorator @staticmethod (see
[http://docs.python.org/2/library/functions.html#staticmethod Python
documentation]). You only need to replace
{{{
def my_generator(self, arg1, arg2, ...):
# bla
}}}
by
{{{
@staticmethod
def my_generator(arg1, arg2, ...)
# bla
}}}
5) Both attributes `index_list` and `index_list_3` are *never* modified by
your program nor used very often. I think it would be better to remove
them. For iteration, you can use
{{{
sage: from itertools import product
sage: for i,j,k in product((1,2),repeat=3):
....: print i,j,k
1 1 1
1 1 2
...
2 2 2
}}}
and for containance test
{{{
sage: t = (1,3,2)
sage: len(t) == 3 and all(i == 1 or i == 2 or i == 3 for i in t)
True
}}}
6) I was not able to build a point in the parametrization. Let say I use
the torus surfaces.Torus(), how do I obtain the coordinates (in `R^3`) of
the point with u=.3 and v=.5 ? It is possible through T.eq_callable but
then the name is bad (I was obliged to read the code to find it!) and it
has no documentation. In the same veine, given (u,v) and a vector x in
`R^2` how do I get the corresponding tangent vector on the surface ?
7) Do you agree to add this example in the doc ?
{{{
sage: S = surfaces.Sphere()
sage: g1 = [c[-1] for c in
S.geodesics_numerical((0,0),(1,0),(0,2*pi,100))]
sage: g2 = [c[-1] for c in
S.geodesics_numerical((0,0),(cos(pi/3),sin(pi/3)),(0,2*pi,100))]
sage: g3 = [c[-1] for c in
S.geodesics_numerical((0,0),(cos(2*pi/3),sin(2*pi/3)),(0,2*pi,100))]
sage: (S.plot(opacity=0.3) + line3d(g1,color='red') +
line3d(g2,color='red') + line3d(g3,color='red')).show()
}}}
Actually it would be nice to also add some tangent vectors to that
picture.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10132#comment:68>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.