Qian Yun
unread,Apr 19, 2026, 9:13:07 AM (3 days ago) Apr 19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fricas-devel
The documentation and implementation of "oblateSpheroidal"
does not match, and the implementation is wrong.
You can verify this by the following snippet from
src/input/coordsys.input:
m(u:DFLOAT,v:DFLOAT):DFLOAT == 1
draw(m,-%pi/2..%pi/2,0..2*%pi,coordinates == oblateSpheroidal(1$DFLOAT))
- Qian
(Disclaimer: this issue is found by LLM, but the analysis and patch
is thoroughly reviewed by me.)
diff --git a/src/algebra/coordsys.spad b/src/algebra/coordsys.spad
index da38d365..4432e340 100644
--- a/src/algebra/coordsys.spad
+++ b/src/algebra/coordsys.spad
@@ -73,9 +73,9 @@
++ oblateSpheroidal(a) transforms from oblate spheroidal
coordinates to
++ Cartesian coordinates: \spad{oblateSpheroidal(a)} is a
function which
++ will map the point \spad{(xi, eta, phi)} to
- ++ \spad{x = a*sinh(xi)*sin(eta)*cos(phi)},
- ++ \spad{y = a*sinh(xi)*sin(eta)*sin(phi)},
- ++ \spad{z = a*cosh(xi)*cos(eta)}.
+ ++ \spad{x = a*cosh(xi)*cos(eta)*cos(phi)},
+ ++ \spad{y = a*cosh(xi)*cos(eta)*sin(phi)},
+ ++ \spad{z = a*sinh(xi)*sin(eta)}.
bipolar : R -> (Pt -> Pt)
++ bipolar(a) transforms from bipolar coordinates to Cartesian
++ coordinates: \spad{bipolar(a)} is a function which will map
@@ -163,7 +163,7 @@
oblateSpheroidal(a) == x +->
pt := copy(x)
xi := elt(x, 1); eta := elt(x, 2); phi := elt(x, 3)
- pt(1) := a*sinh(xi)*sin(eta)*cos(phi)
+ pt(1) := a*cosh(xi)*cos(eta)*cos(phi)
pt(2) := a*cosh(xi)*cos(eta)*sin(phi)
pt(3) := a*sinh(xi)*sin(eta)
pt