summaryrefslogtreecommitdiffstats
path: root/org
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2012-04-18 00:20:17 +0200
committerDavid A. Madore <david+git@madore.org>2012-04-18 00:20:17 +0200
commit8be15afc02e4e82b30a4e8457098547ac4c062d2 (patch)
tree8083c9f88ed99d4d3dfde738589c777c46550023 /org
parent13a0fa9046fb85626ccd49f46fe4dec9f5e32e46 (diff)
downloadephem-8be15afc02e4e82b30a4e8457098547ac4c062d2.tar.gz
ephem-8be15afc02e4e82b30a4e8457098547ac4c062d2.tar.bz2
ephem-8be15afc02e4e82b30a4e8457098547ac4c062d2.zip
Slight improvement to test proram.
Diffstat (limited to 'org')
-rw-r--r--org/madore/ephem/Test.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org/madore/ephem/Test.java b/org/madore/ephem/Test.java
index 0551837..cb9dc82 100644
--- a/org/madore/ephem/Test.java
+++ b/org/madore/ephem/Test.java
@@ -5,7 +5,11 @@ import java.util.Date;
public final class Test {
public static void main(String[] args) {
- Date now = new Date();
+ Date now;
+ if ( args.length >= 1 )
+ now = new Date(Long.parseLong(args[0]));
+ else
+ now = new Date();
long nowTime = now.getTime();
int nowUtcMjd = (int)(nowTime/86400000) + 40587;
double nowUtcSeconds = (nowTime%86400000)/1000.;
@@ -32,6 +36,10 @@ public final class Test {
Math.atan(sun.v[2]/Math.sqrt(sun.v[0]*sun.v[0]+sun.v[1]*sun.v[1]))/Comput.degree,
Math.atan2(sun.v[1], sun.v[0])/Comput.degree);
sun = Precession.matrix(Ephem.fromJd(nowTtJd)).apply(sun0);
+ sun0 = Frames.Rotation.rotx(Precession.epsilon.v(Ephem.fromJd(nowTtJd))*Comput.arcsecond).apply(sun);
+ System.out.format("☉ ecliptic(mean) lat=%.6f° long=%.6f°\n",
+ Math.atan(sun0.v[2]/Math.sqrt(sun0.v[0]*sun0.v[0]+sun0.v[1]*sun0.v[1]))/Comput.degree,
+ Math.atan2(sun0.v[1], sun0.v[0])/Comput.degree);
System.out.format("☉ equatorial(mean) lat=%.6f° long=%.6f°\n",
Math.atan(sun.v[2]/Math.sqrt(sun.v[0]*sun.v[0]+sun.v[1]*sun.v[1]))/Comput.degree,
Math.atan2(sun.v[1], sun.v[0])/Comput.degree);