View previous topic :: View next topic 
Author 
Message 
stcisz
Joined: 19 Nov 2016 Posts: 19

Posted: Mon Nov 21, 2016 6:22 pm Post subject: Oblique Ascendant 


I'm writing an astrological application based on "Radix System" by V.E. Robson. One of the thing to be computed is oblique ascendant i.e. the ascendant position when M.C, and location is given. I wrote following procedure:
Code:  function computeAsc(mc) {
var T = (hor.jdate  2451545.0) / 36525;
var eta = 23 + 26/60 + 21.45/(60*60) 
46.815/60 * T  0.0006/60 * T * T + 0.00181/60 * T * T * T;
var RAMC = Math.atan(Math.tan(mc * Math.PI / 180) *
Math.cos(eta * Math.PI/180));
y = (Math.sin( RAMC) + Math.tan(eta * Math.PI / 180) *
Math.tan(hor.latitude * Math.PI / 180)) *
Math.cos(eta * Math.PI / 180)
x = Math.cos(RAMC);
asc = Math.atan2(x,y);
return asc * 180 /Math.PI;
}
 and got strange results. Could anyone point me where is an error.
Best regards,
Staszek 

Back to top 


skyrack
Joined: 02 Aug 2012 Posts: 184 Location: Thailand

Posted: Tue Nov 22, 2016 8:53 am Post subject: 


Is that javascript or? 

Back to top 


stcisz
Joined: 19 Nov 2016 Posts: 19

Posted: Tue Nov 22, 2016 9:01 am Post subject: 


Yes, it is. 

Back to top 


Ursa Major
Joined: 28 Jul 2010 Posts: 24 Location: Limburg

Posted: Tue Nov 22, 2016 9:07 am Post subject: 


I have changed your function in the following. Hope it helps.
var T = ( hor.jdate  2451545.0 ) / 36525;
var eta = ( 84391.45  46.815 * T  0.0006 * T * T + 0.00181 * T * T * T ) / 3600.0;
var RAMC = Math.atan( Math.tan( mc * Math.PI / 180 ) * Math.cos( eta * Math.PI / 180 ));
var OB = eta * Math.PI / 180;
y = Math.sin( RAMC ) * Math.cos( OB )  Math.tan( hor.latitude * Math.PI / 180 ) * Math.sin( OB );
x = Math.cos( RAMC );
asc = Math.atan2( x, y );
return asc * 180 / Math.PI; 

Back to top 


stcisz
Joined: 19 Nov 2016 Posts: 19

Posted: Tue Nov 22, 2016 6:36 pm Post subject: 


Thank you for interest. Unfortunately after change procedure the problem persist. For value of latitude 49.60889, jdate 2440704.6493055555 and mc 214.29666062554156 procedure returns 138.385708051255. This is close to directional Desc or about 180 degrees from an expected position.
Best regards,
Staszek 

Back to top 


Ursa Major
Joined: 28 Jul 2010 Posts: 24 Location: Limburg

Posted: Tue Nov 22, 2016 7:37 pm Post subject: 


You have to add lines between Var RAMC en Var OB
See the mail I send to you.
In short:
if RAMC less then 0 you have to add Math.PI to RAMC
if mc greater then Math.PI you have again add Math.PI to RAMC 

Back to top 


Ursa Major
Joined: 28 Jul 2010 Posts: 24 Location: Limburg

Posted: Wed Nov 23, 2016 1:36 pm Post subject: 


# Input given by you
mc = 214.29666062554156
hor.latitude = 49.60889
hor.jdate = 2440704.64931
I change your function in the following:

Var T = ( hor.jdate  2451545.0 ) / 36525;
Var eta = ( 84391.45  46.815 * T  0.0006 * T * T + 0.00181 * T * T * T ) / 3600.0;
Var ob = Math.radians( eta );
y =  Math.sin( Math.radians( mc )) * Math.cos( ob )  Math.tan( Math.radians( hor.latitude )) * Math.sin( ob ) ;
x = Math.cos( Math.radians( mc ));
asc = Math.atan2( x, y ) ;
asc = Math.degrees( asc ) ;
if asc < 0 : asc = asc + 360;
return asc;

It gives as result: 273.414872 ...
With best regards, 

Back to top 


stcisz
Joined: 19 Nov 2016 Posts: 19

Posted: Wed Nov 23, 2016 2:57 pm Post subject: 


Looks that those formulas works. Thank you very much.
Best regards,
Staszek 

Back to top 


