# HG changeset patch
# User Jean-Pierre Flori <jean-pierre.flor@ssi.gouv.fr>
# Date 1337793906 -7200
# Node ID d0a5c76505d257da0ca3ad976114da524f80be0f
# Parent 3ffe805bcae22f459550805ac4a48b3d49a61a92
Trac #12950: Handle axis=(0,0) separately in revolution_plot3d
diff --git a/sage/plot/plot3d/revolution_plot3d.py b/sage/plot/plot3d/revolution_plot3d.py
a
|
b
|
|
154 | 154 | if parallel_axis=='z': |
155 | 155 | x0=axis[0] |
156 | 156 | y0=axis[1] |
157 | | phase=atan2((y-y0),(x-x0)) |
| 157 | # (0,0) must be handled separately for the phase value |
| 158 | phase=0 |
| 159 | if x0!=0 or y0!=0: |
| 160 | phase=atan2((y-y0),(x-x0)) |
158 | 161 | R=sqrt((x-x0)**2+(y-y0)**2) |
159 | 162 | v=(R*cos(phi+phase)+x0,R*sin(phi+phase)+y0,z) |
160 | 163 | elif parallel_axis=='x': |
161 | 164 | y0=axis[0] |
162 | 165 | z0=axis[1] |
163 | | phase=atan2((z-z0),(y-y0)) |
| 166 | # (0,0) must be handled separately for the phase value |
| 167 | phase=0 |
| 168 | if z0!=0 or y0!=0: |
| 169 | phase=atan2((z-z0),(y-y0)) |
164 | 170 | R=sqrt((y-y0)**2+(z-z0)**2) |
165 | 171 | v=(x,R*cos(phi+phase)+y0,R*sin(phi+phase)+z0) |
166 | 172 | elif parallel_axis=='y': |
167 | 173 | x0=axis[0] |
168 | 174 | z0=axis[1] |
169 | | phase=atan2((z-z0),(x-x0)) |
| 175 | # (0,0) must be handled separately for the phase value |
| 176 | phase=0 |
| 177 | if z0!=0 or x0!=0: |
| 178 | phase=atan2((z-z0),(x-x0)) |
170 | 179 | R=sqrt((x-x0)**2+(z-z0)**2) |
171 | 180 | v=(R*cos(phi+phase)+x0,y,R*sin(phi+phase)+z0) |
172 | 181 | |