diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-07-18 17:37:11 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-07-18 17:37:11 +0000 |
commit | 8b734e46072a9614f8ffe12d3a10dcca558644a6 (patch) | |
tree | e2b0c193d0ed84080e077b203cc594818d65a64a /archive/ellipsoid.maple | |
parent | cbe4d2f21a92dcabaa90d8d2d4c1054d8cc1b68f (diff) |
directory to hold stuff that's no longer used but that someone might want
to look at again
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@630 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'archive/ellipsoid.maple')
-rw-r--r-- | archive/ellipsoid.maple | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/archive/ellipsoid.maple b/archive/ellipsoid.maple new file mode 100644 index 0000000..0c485fa --- /dev/null +++ b/archive/ellipsoid.maple @@ -0,0 +1,35 @@ +# ellipsoid.maple -- compute equations for offset ellipsoid setup +# $Header$ + +# +# ellipsoid has center (A,B,C), radius (a,b,c) +# angular coordinate system has center (U,V,W) +# +# direction cosines wrt angular coordinate center are (alpha,beta,gamma) +# but Maple predefines gamma = Euler's constant, so we use (xcos,ycos,zcos) +# instead, i.e. a point has coordinates (U+xcos*r, V+ycos*r, W+zcos*r) +# +# then the equation of the ellipsoid is +# (U+xcos*r - A)^2 (V+ycos*r - B)^2 (W+zcos*r - C)^2 +# ----------------- + ---------------- + ----------------- = 1 +# a^2 b^2 c^2 +# +# to solve this, we introduce intermediate variables +# AU = A - U +# BV = B - V +# CW = C - W +# +eqn := (xcos*r - AU)^2/a^2 + (ycos*r - BV)^2/b^2 + (zcos*r - CW)^2/c^2 = 1; + +read "../maple/util.mm"; +read "../maple/codegen2.mm"; + +[solve(eqn, r)]; +map(simplify, %); +[r_plus = %[1], r_minus = %[2]]; +solnlist := [codegen[optimize](%)]; + +ftruncate("ellipsoid.c"); +print_name_list_dcl(temps_in_eqnlist(solnlist, [r_plus,r_minus]), + "fp", "ellipsoid.c"); +codegen[C](solnlist, filename="ellipsoid.c"); |