diff options
| author | Christoph Berg <christoph.berg@credativ.de> | 2022-08-23 10:23:16 +0200 |
|---|---|---|
| committer | Christoph Berg <christoph.berg@credativ.de> | 2022-08-23 10:23:16 +0200 |
| commit | 2d1068e60bce7ae1fff11623454900e8cee956b1 (patch) | |
| tree | acebe276e30466ef0ab91bc3da5e379bec0d7dc5 /map65/libm65/toxyz.f90 | |
| parent | 43bebfbad6e7ba026bd3d55720c7d9e12a7ef8ef (diff) | |
New upstream version 2.6.0~rc3+repackupstream/2.6.0_rc3+repack
Diffstat (limited to 'map65/libm65/toxyz.f90')
| -rwxr-xr-x | map65/libm65/toxyz.f90 | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/map65/libm65/toxyz.f90 b/map65/libm65/toxyz.f90 index aef160c9..82b8f851 100755 --- a/map65/libm65/toxyz.f90 +++ b/map65/libm65/toxyz.f90 @@ -1,25 +1,25 @@ -subroutine toxyz(alpha,delta,r,vec) - - implicit real*8 (a-h,o-z) - real*8 vec(3) - - vec(1)=r*cos(delta)*cos(alpha) - vec(2)=r*cos(delta)*sin(alpha) - vec(3)=r*sin(delta) - - return -end subroutine toxyz - -subroutine fromxyz(vec,alpha,delta,r) - - implicit real*8 (a-h,o-z) - real*8 vec(3) - data twopi/6.283185307d0/ - - r=sqrt(vec(1)**2 + vec(2)**2 + vec(3)**2) - alpha=atan2(vec(2),vec(1)) - if(alpha.lt.0.d0) alpha=alpha+twopi - delta=asin(vec(3)/r) - - return -end subroutine fromxyz +subroutine toxyz(alpha,delta,r,vec)
+
+ implicit real*8 (a-h,o-z)
+ real*8 vec(3)
+
+ vec(1)=r*cos(delta)*cos(alpha)
+ vec(2)=r*cos(delta)*sin(alpha)
+ vec(3)=r*sin(delta)
+
+ return
+end subroutine toxyz
+
+subroutine fromxyz(vec,alpha,delta,r)
+
+ implicit real*8 (a-h,o-z)
+ real*8 vec(3)
+ data twopi/6.283185307d0/
+
+ r=sqrt(vec(1)**2 + vec(2)**2 + vec(3)**2)
+ alpha=atan2(vec(2),vec(1))
+ if(alpha.lt.0.d0) alpha=alpha+twopi
+ delta=asin(vec(3)/r)
+
+ return
+end subroutine fromxyz
|
