A couple of years ago I was looking at the Ring Nebula (M 57) at relatively high power and noticed how bad it looked. It was early May and it was low on the horizon. Now I have always read that when an object is at zenith, that you are looking through considerably less atmosphere then when it is near the horizon. I have never seen this displayed numerically.
So, I wrote a little program to estimate how much atmosphere I was really
looking through at specific angles. The first step should always be to
define the problem. (A graph often helps.
)
In the figure1 point A, is where the telescope is. The line going from point A through point B is the line of sight of the telescope. And point B is where the line of sight exits earth's atmosphere and enters space. Point C is the center of the earth.
The solution I went for is as follows: If we see line AB not as just a line, but as a right triangle we could then determine for some unit of length, how much the vertical(x) and horizontal(y) will change.
According to my old college trig book the sin(angle) = Opposite / Hypotenuse.
Where the hypotanuse is lineAB, Opposite is the vertical line connected to point B and Adjacent is the horizontal line connected to point A.
For simplicity's sake lets assume the length of the hypotenuse of 1 meter, then the formula becomes:
sin(angle) = opposite / 1
Which would simplify into
sin(angle) = opposite
We do a similar thing with
Cos(angle) = Adjacent / hypotenuse,
giving us cos(angle) = Adjacent.
So we then create a loop where we keep incrementing a sum value for
both adjacent and the opposite and the length of the line AB. But we also
have to know when to stop (see figure 2.) We know that the Earth's radius
is about 4000 miles and the atmosphere is about 50 miles thick, the line
BC can not exceed the sum of those values. To determine if we have reached
that value yet, we can sum the squares of (x + the radius of the Earth) and
y and take the square root of that - x2 + y2 = z2,
also known as Pythagorean theorem.
Further notes on the program:
I used Borland's Delphi version 4 Professional, which can be bought on eBay for next to nothing. Delphi is a descendent of Turbo Pascal and uses the superset of the Turbo Pascal language called Object Pascal. It is a point and click sort of environment that gives relatively good performance. Generally speaking, the programmer selects an object off of the toolbox and then double clicks on one of the possible events and then the source code editor pops open. At that point the programmer adds his source code for that event. Therefore, I am just including the source code snippet from that event, which was a button click.
The lines of code with a reference to AngleGrid is a Delphi Table object
where I am displaying the output of my program. Also the lines with references
to series1 is a graphing object. And lastly the reference to FtEdit is
a value taken from the user indicating how many feet the observer is above
sea level.
procedure TForm1.CompButtonClick(Sender: TObject);
Const
KKMile = 1609.344;
KKDist = 3963.1;
Var
i: Integer;
XInc, YInc, XSum, Ysum, MeterSum, CoreDist, Angle: Double;
begin
AngleGrid.Cells[0,0] := 'Angle';
AngleGrid.Cells[1,0] := 'Distance';
For i:= 0 to 17 Do
Begin
Angle := i * 5;
YInc := Sin(Angle *(Pi/180));
XInc := Cos(angle *(Pi/180));
YSum := StrToFloat(FtEdit.Text) * 0.3048;
XSum := 0.0; MeterSum := 0.0;
Repeat
XSum := XSum + XInc * 100;
YSum := YSum + YInc * 100;
MeterSum := MeterSum + 100;
CoreDist :=Sqr(XSum / KKMile) +
Sqr(YSum / KKMile + KKDist);
CoreDist := Sqrt(CoreDist);
Until (CoreDist >= (KKDist + 50.0));
AngleGrid.Cells[0,i+1] := FloatToStr(i*5);
AngleGrid.Cells[1,i+1] := FloatToStr(MeterSum / KKMile);
Series1.AddXY(i * 5, MeterSum / KKMile,'',clTeeColor);
End;
end;
Example with input of 1500 ft above sea level.