예제 #1
0
        public static PreciseVector getPlanetVelocity(string abb, float JDE, float deltaT)
        {
            PreciseVector l0 = getPlanetPosition(abb, JDE);
            PreciseVector dl = getPlanetPosition(abb, JDE + deltaT);

            return((dl - l0) * (58.14f / deltaT)); //convert from au/days - 58.1 because wolfram said so (1 / (earth average velocity in au/day))
        }
예제 #2
0
        public static double angle(PreciseVector a, PreciseVector b)
        {
            double cos = scalar(a, b) / (length(a) * length(b));

            return(Math.Acos(cos));
        }
예제 #3
0
 public static double distance(PreciseVector a, PreciseVector b)
 {
     return(Math.Sqrt(Math.Pow(a.x - b.x, 2) + Math.Pow(a.y - b.y, 2)));
 }
예제 #4
0
 public static double length(PreciseVector v)
 {
     return(Math.Sqrt(Math.Pow(v.x, 2) + Math.Pow(v.y, 2)));
 }
예제 #5
0
 public static double scalar(PreciseVector a, PreciseVector b)
 {
     return(a.x * b.x + a.y * b.y);
 }