No BSD License  

Highlights from
Skyplot1001

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

mag=bright(PNr,R,DELTA,PHI,DEC,DLONG)
function mag=bright(PNr,R,DELTA,PHI,DEC,DLONG)

% function mag=bright(PNr,R,DELTA,PHI,DEC,DLONG)
% 
% apparent brightness of a planet (in mag)
% algorithms by Montenbruck/Pfleger: "Astronomy with the Personal Computer"
%
% 05.05.04 M.Penzkofer

P = PHI/100.0;

switch PNr
   case 1	% Mercury
      MAG = -0.42 + ( 3.80 - ( 2.73 - 2.00*P ) * P ) * P;
	case 2	% Venus
      MAG = -4.40 + ( 0.09 + ( 2.39 - 0.65*P ) * P ) * P;
   case 3	% Earth
      MAG = -3.86;
   case 4	% Mars
      MAG = -1.52 + 1.6 * P;
   case 5	% Jove
      MAG = -9.40 + 0.5 * P;
   case 6	% Saturn
      SD = abs( sin(DEC) );
      DL = abs( DLONG/100.0 );
      if (DL > 1.8)
         DL=abs(DL-3.6);
      end
      MAG = -8.88 - 2.60 * SD + 1.25 * SD*SD + 4.40 * DL;
	case 7	% Uranus
      MAG = -7.19;
   case 8	% Neptune
      MAG = -6.87;
   case 9	% Pluto
      MAG = -1.0;
end

mag = MAG + 5.0 * log( R*DELTA ) / log(10);

Contact us at files@mathworks.com