Navigation:Home > Content >

astro_func_(2).mq4

Time: 2010-06-03 | Download file:astro_func_(2).mq4

#include 


// Угловое расстояние - макс 180
double func_P(double input1, double input2)
{
   if ( MathAbs(input1-input2) > 180 )
   {
     return( 360 - MathMax(input1, input2) + MathMin(input1, input2) );
   }
   else
   {
     return( MathAbs(input1-input2) );
   }
}

// Угловое расстояние - макс 360
double func_P360(double fast, double slow)
{
   if (fast >= slow)
   {
     return( fast - slow );
   }
   else
   {
     return( 360 - (slow-fast) );
   }
}



bool is_retrograde(datetime d, int period, int Body, int iflag)
{
   double longtitude_past, latitude_past;
   double longtitude_now, latitude_now;
   double tmp;
   
   astro_swe_calc(d-period, Body, iflag, longtitude_past, latitude_past, tmp, tmp);
   astro_swe_calc(d, Body, iflag, longtitude_now, latitude_now, tmp, tmp);
   
   if(longtitude_now < longtitude_past)
   {
     return(1);
   }
   else
   {
     return(0);
   }
}







/*
// Знак
int astro_Sign(double value)
{
   return( MathFloor(value/30) );
}


///////////////////////////////////////////////////////////////

bool is_top_v180(double v180, double orbis,double value, double value_m1, double value_p1)
{
   if(
       //180
       ((value>value_m1)&&(value>value_p1))
       ||(v180-value0)&&(value_p1-90<0))||((value-90<0)&&(value_p1-90>0))) && (MathAbs(value-90)0)&&(value_m1-90<0))||((value-90<0)&&(value_m1-90>0))) && (MathAbs(value-90)        

Recommend