No BSD License  

Highlights from
Skyplot1001

image thumbnail
from Skyplot1001 by Markus Penzkofer
Virtual Planetarium showing stars, the planets, the sun and the moon.

[A,D,W,sense]=orient(PNr,System,T)
function [A,D,W,sense]=orient(PNr,System,T)

% function [A,D,W,sense]=orient(PNr,System,T)
%
% parameters of the planetocentric coordinate system of a planet
% algorithms by Montenbruck/Pfleger: "Astronomy with the Personal Computer"
%
% 05.05.04 M.Penzkofer

% check input values
if (PNr < 1 | PNr > 9)
   disp('Enter number between 1 and 9!');
   return
end
if (System < 1 | System > 3)
   disp('Enter system 1,2 or 3!')
   return
end

% rectascension and deklination of the rotation axis
switch PNr
	case 1	% Mercury
      A = 281.02 - 0.033*T;
      D =  61.45 -0.005*T;
   case 2	% Venus
      A = 272.78;
      D =  67.21;
   case 3	% Earth
      A =   0.00 - 0.641*T;
      D =  90.00 -0.557*T;
   case 4	% Mars
      A = 317.681- 0.108*T;
      D =  52.886-0.061*T;
   case 5	% Jove
      A = 268.05 - 0.009*T;
      D =  64.49 +0.003*T;
   case 6	% Saturn
      A =  40.66 - 0.036*T;
      D =  83.52 -0.004*T;
   case 7	% Uranus
      A = 257.43;
      D = -15.10;
   case 8	% Neptune
      A = 295.33;
      D =  40.65;
   case 9	% Pluto
      A = 311.63;
      D =   4.18;
end


% orientation of the zero meridian
TD = 36525.0 * T;

switch PNr
	case 1	% Mercury
      W = 329.710 +   6.1385025*TD;
   case 2	% Venus
      W = 159.910 -   1.4814205*TD;
   case 3	% Earth
      W = 100.21  + 360.9856123*TD;
   case 4	% Mars
      W = 176.655 + 350.8919830*TD;
   case 5	% Jove
      switch System
         case 1
            W =  67.10 + 877.900*TD;
         case 2
            W =  43.30 + 870.270*TD;
         case 3
         	W = 284.95 + 870.536*TD;
      end
   case 6	% Saturn
      switch System
         case 1
            W = 227.2037 + 844.3000000*TD;
         case 2
         	W = 227.2037 + 844.3000000*TD;
			case 3
            W =  38.90   + 810.7939024*TD;
         end
   case 7	% Uranus
      W = 261.620 - 554.913*TD;  % System III
   case 8	% Neptune
      W = 107.210 + 468.75 *TD;  % System III
   case 9	% Pluto
      W = 252.660 -  56.364*TD;
end

W = W/360.0;
W = 360.0*(W-fix(W));


% sense of rotation
if (PNr == 1 | PNr == 3 | PNr == 4 | PNr == 5 | PNr == 6 | PNr == 7)
   % MERCURY,EARTH,MARS,JUPITER,SATURN,NEPTUNE
   sense = 'DIRECT';
else
   % VENUS,URANUS,PLUTO
   sense = 'RETROGRADE';
end

Contact us at files@mathworks.com