Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3557 by [email protected]: bug in diffgeom for conversion between coordinate systems
http://code.google.com/p/sympy/issues/detail?id=3557

I'm trying to create a simple script to convert the coordinates (x,y,z)
from one system to another coordinate system (r,theta,phi).

The parametric equations for x,y,z are given by
x = (a1 + r*(a2-a1)) * cos(theta) * cos(phi)
y = (a1 + r*(a2-a1)) * cos(theta) * sin(phi)
z = (c1 + r*(c2-c1)) * sin(theta)

This is my code :

r, theta, phi = symbols('r, theta, phi')
m = Manifold('M', 2)
patch = Patch('P', m)
rect = CoordSystem('rect', patch)
ellip = CoordSystem('ellip', patch)

# Connect the coordinate systems
# An inverse transformation is automatically found by solve when
possible
a1, a2 = 1.1, 1.7
c1, c2 = 2.5, 2.8

a = a1+r*(a2-a1)
c = c1+r*(c2-c1)

ellip.connect_to(rect, [r,theta,phi], [a*cos(theta)*cos(phi),
a*cos(theta)*sin(phi), c*sin(theta)])

then I have the following error:

Manifold(M, 2)
Patch(P, Manifold(M, 2))
Traceback (most recent call last):
File "ellipsoid.py", line 24, in <module>
ellip.connect_to(rect, [r,theta,phi], [a*cos(theta)*cos(phi),
a*cos(theta)*sin(phi), c*sin(theta)])
File "/usr/lib/python3.3/site-packages/sympy/diffgeom/diffgeom.py", line
217, in connect_to
to_sys.transforms[self] = self._inv_transf(from_coords, to_exprs)
File "/usr/lib/python3.3/site-packages/sympy/diffgeom/diffgeom.py", line
232, in _inv_transf
inv_to = inv_to[0]
IndexError: list index out of range

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to