Amiga.org

Coffee House => Coffee House Boards => CH / Science and Technology => Topic started by: KennyR on July 21, 2004, 04:18:07 AM

Title: Calculating the distance between stars
Post by: KennyR on July 21, 2004, 04:18:07 AM
That's what I wanna do. I know a star's location in the sky by its altitude and azimuth at any point in time, and I can look up the distance from our Sun to them in the same way.

But what I want to do is compare two stars and calculate the distance between them, non-relative to Earth. I've tried using everything I know about maths, which is a lot, but apparently not enough. Google isn't helping either; the internet has a few formulae, but the only ones I could find measure the distance in radians of arc, which are only useful relative to Earth. I want the distance in parsecs or light years. If I could convert radians of arc to light years I'd be happy, but I can't.

Sperical trigonometry isn't one of the things I had to learn as a chemist (phew), so has any mathematician or astronomer or astrophysisist out there got an easy formula or method?
Title: Re: Calculating the distance between stars
Post by: Cyberus on July 21, 2004, 10:37:34 AM
Quote

KennyR wrote:
That's what I wanna do. I know a star's location in the sky by its altitude and azimuth at any point in time, and I can look up the distance from our Sun to them in the same way.

But what I want to do is compare two stars and calculate the distance between them, non-relative to Earth. I've tried using everything I know about maths, which is a lot, but apparently not enough. Google isn't helping either; the internet has a few formulae, but the only ones I could find measure the distance in radians of arc, which are only useful relative to Earth. I want the distance in parsecs or light years. If I could convert radians of arc to light years I'd be happy, but I can't.

Sperical trigonometry isn't one of the things I had to learn as a chemist (phew), so has any mathematician or astronomer or astrophysisist out there got an easy formula or method?


I'll get back to you with an answer. I studied Astophysics for my BSc, and you know, I can't bloody remember!
Perhaps you can use the Parallax method to determine the distance to each star. And then with the altitude and azimuth angles, work out the distance between them?

I'll have a think about it, and get back to you later, that's if Blobrana doesn't beat me to it :-)
Title: Re: Calculating the distance between stars
Post by: PMC on July 21, 2004, 10:48:18 AM
Quote

Cyberus wrote:

I'll have a think about it, and get back to you later, that's if Blobrana doesn't beat me to it :-)


If you're really lucky, maybe she'll write you a poem about it too?

;-)
Title: Re: Calculating the distance between stars
Post by: Cymric on July 21, 2004, 11:16:51 AM
Not being hindered by any knowledge on astronomy whatsoever (well, not a lot ;-)), isn't this just a problem of converting the spherical coordinates (altitude, azimuth, distance) to Cartesian ones and then applying Pythagoras' theorem? In fact, I'm sure that if I haul out my textbook on differential geometry I could apply Pythagoras directly to the spherical coordinates, but since that involves some messy mathematics with Jacobians and what-not, I prefer to use the workaround I understand.

In other words, assuming a right-handed (x, y, z)-coordinate system, with f the angle {P_x}{O}{P_y} (= azimuth), g the angle {P}{O}{P_z} (= 90 degrees minus altitude), and r the distance to the Sun, with P the position of the star in space, and a subscript indicating its projection on either one of the three coordinate axes, my math lecture notes state that

   P_x = r cos(f) sin(g)
   P_y = r sin(f) cos(g)
   P_z = r cos(g)

Of course these formulas do not take into account the lattitude of the observer, nor the tilt of Earth's axis, nor the angle of the ecliptic. But somehow, I feel that those will simply fall out of the equation if azimuth and altitude are given relative to the constant observer's location: of course the absolute distance between stars should not depend  on the position of the observer on Earth. Continuing, therefore, the position of the second star R is given b y a similar set of equations, resulting in a distance D of

    D^2 = (r cos(f) sin(g) - r' cos(f') sin(g'))^2 + (r sin(f) cos(g) - r' sin(f') cos(g'))^2 + (r cos(g) - r' cos(g'))^2

Of course the above is more or less an educated guess, so take it with a pinch of salt, and try to obtain verification from people who did astronomy rather than chemical engineering ;-).

Edit: corrected the angle for the altitude.
Title: Re: Calculating the distance between stars
Post by: Karlos on July 21, 2004, 12:41:12 PM
Thinking about it, this is probably exactly the same solution as cymric's, but if you can express the distance from your point of reference (taken as the origin) to each star as a point vector (you can convert between spherical coordinates to 3D vector coordinates relatively easily), the distance between the two stars is simply the magnitude of the vector you get between them.

distance = sqrt((P1x-P2x)^2 + (P1y-P2y)^2 + (P1z-P2z)^2);

where P1 and P2 are the position vectors (eg unit light year or whatever you are working with) relative to you at the origin.

These in turn can be evaluated by their known distances from earth and their angular coordinates (r,theta,phi (or whatever it is))...
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 12:55:23 PM
Hum,
To figure it roughly don't bother with Spherical trigonometry,
Just use standard 2d coordinates with Pythagoras theorem...

You need to know the distances of the two stars from the earth, and since that is a very rough estimate then that cuts down on the overall errors...


Perhaps if you imagine the one stars eclipsing the other star then it’s a simple case of subtracting one distance from another...

As you separate the two stars just use Pythagoras theorem (2d not even 3d coordinates) to work out the distance...
[Draw a line through both stars, it doesn’t matter the about alt or dec sime there is no up in space, and no one can hear you scream...]
Title: Re: Calculating the distance between stars
Post by: Karlos on July 21, 2004, 01:02:45 PM
Actually, and I don't know why this didnt occur before, but yeah, blobrana is right about not strictly needing 3D maths :-D

Since you have only 3 points, the two stars and your point of reference, any 3 distinct points always lie in a plane, reducing the problem to a 2D one.

If you know their distances from you, and the direct angle subtended between them (from your position), you can calculate the distance between them using basic triangle geometry (you know 2 lengths and the angle between them, calculating the third length should be trivial).
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 01:18:31 PM
Hum,
but if you do want to mess up you head with Cartesian coordinates (you still need to convert the earth observed stars into an angle) check this (http://vp.ispcal.com/sgc/sgc2.htm)



 :-)
Title: Re: Calculating the distance between stars
Post by: Cyberus on July 21, 2004, 01:25:11 PM
Would it not be easier to use sine rule rather than pythagoras?
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 02:09:41 PM
Hum,
yes, its better, but i find right-angles easier to work out in my head...
from those stellar distances you can really use the base angle to be almost 90 degrees...


The `right angle` is the same distance away as the closest star....
(http://www.ucl.ac.uk/Mathematics/geomath/trignb/span31.gif)
The `opposte` length is star2 - star1(closest)
So it`s a simple case to work out the hypotenuse

See! (http://www.ucl.ac.uk/Mathematics/geomath/trignb/trig11.html)





























The Earth- X
Title: Re: Calculating the distance between stars
Post by: Cymric on July 21, 2004, 02:23:10 PM
Yeah, okay, granted, you can reduce the 3D problem to a 2D one. But I think it doesn't solve anything, as you now are faced with the problem of calculating the angle subtended between the two stars, as it does not trivially follow from the two angles associated with each star's position. (Try it for yourself.) Look at it this way: three distinct points indeed lie in a plane, and it is trivial to construct the equation for that plane provided the coordinates are Cartesian. Unfortunately, the are not, they are spherical. Things are much more complex when you try to do it with them buggers. I have a strong hunch that if you come up with a formula to compute the required subtended angle, and then used 2D-Pythagoras or the sine rule, you'd be doing exactly the same amount of work as I did, but via a tricky and not really necessary 3D->2D transformation.

Things are of course completely different if you get the subtended angle as a function of time straight from the beginning. But that is not what Kenny gave us to work with.
Title: Re: Calculating the distance between stars
Post by: Cymric on July 21, 2004, 02:29:57 PM
Quote
blobrana wrote:
from those stellar distances you can really use the base angle to be almost 90 degrees...

Which angle is almost 90 degrees? Say you're dealing with Alcor and Mizar (the famous double in the tail of the Great Bear), I cannot make out any angle close to this value. Could you please explain?
Title: Re: Calculating the distance between stars
Post by: bloodline on July 21, 2004, 02:33:55 PM
Isn't it easier just to say:

"Really really far, even on horseback..."

:-D
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 02:54:01 PM
Hum,
OK, (to use the sine method)
Here’s an example of the blue and red stars of Orion...

Betelgeuse RA:   5h55m00.00s   DE:+07°00'00.0"

RIGEL RA:   5h10m00.00s   DE:-08°00'00.0"

And remembering that 24h = 360º, 1h = 15º etc...

[The angle from the earth is about 18 degrees]
remember that 15 degrees = 1 hour

So 45minutes difference in the RA of the two stars = 45/60 x 15 = 11 degrees (thats one side)

The DEC is -8 - 7 = 15 degrees (the other side)

11sqr=121  15sqr=225   121+225=346 srqroot = 18.6degrees....


We have the angle!

Now all we need are the distances in light years to the two stars...



@Cymric
(to use the rough method)
the angle of the base line....(adjacent) the rightangle is the same distance from the earth as the first star...

the differance between alcor and mizar is a few seconds......the base line, in this case,would be so small  as to be forgotten about...(unless they were very close together)in which case
Title: Re: Calculating the distance between stars
Post by: KennyR on July 21, 2004, 05:59:23 PM
Thanks for your replies. It seems to me that working out the cartesian coords first and then doing pythagoras on them, like Cymric said, would be the best way to do it. At least, it would be the most accurate way. I'm not convinced that 2D math is any good on a sphere.

But...! Why don't we all test our theories? Blobrana gave us two stars, with coordinates:

Betelgeuse RA: 5h55m00.00s DE:+07°00'00.0"

RIGEL RA: 5h10m00.00s DE:-08°00'00.0"

Betelgeuse is 650 ly from Earth, Rigel is 1400 ly. Now, what is the distance between them?
Title: Re: Calculating the distance between stars
Post by: Karlos on July 21, 2004, 06:49:14 PM
Quote

KennyR wrote:
I'm not convinced that 2D math is any good on a sphere.


That isn't quite what anybody was implying. The 2D argument comes from the observation that you have only 3 points to consider and any three distinct points always lie in a 2D plane (basically defining a perfectly ordinary 2D triangle within that plane). I should point out that I'm not convinced that the simple pythagoras right angle triangle stuff applies, but if you know the length of any two sides of a triangle and angle subtended between them, you can work out the other angles and side length.
 
Of course the difficulty is that you still have to determine the angle subtended between the lines connecting star1 and star2 to your point of reference.

Ultimately, I'm sure it would be the same complexity as cartesian conversion of the stars locations relative to earth and the resulting vector length.

I'm a tad busy but I will give the vector length and angle subtended versions a go when I have some time :-)
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 06:50:16 PM
Hum,
have you a calculator?

The two sides of the  triangle are  a and b, and the angle in between, C, - it`s `easy` to find the remaining side x.  by using the cosine formula:
x²  = a²  + b²  - 2 a b cos C

x²  = 1400²  + 650 ²  - 2* 1400 *650 * cos 18

=? (some one work it out for me)


[we know the angle C from as 18 degrees, the distances are already `known`]

[And it all is on a 2d plane, yeah, really ]
Title: Re: Calculating the distance between stars
Post by: Karlos on July 21, 2004, 06:53:32 PM
@blob

That's what I mean :-)

x = 807 light years.
Title: Re: Calculating the distance between stars
Post by: KennyR on July 21, 2004, 06:53:52 PM
Blob, the answer to that equation you printed is:

1180723.5909957732

Thats way, way off what I got. :-o
Title: Re: Calculating the distance between stars
Post by: Karlos on July 21, 2004, 06:57:55 PM
@Kenny

Remember order of precedence

x = sqrt((1400*1400)+(650*650)-(2*1400*650*cos(18 deg)))
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 07:00:07 PM
hum
is that x²?

/¯1180723.5909957732  = 1086 light years ?

Title: Re: Calculating the distance between stars
Post by: KennyR on July 21, 2004, 07:00:39 PM
I did it with cartesians, and I got:

798.949 light years.
Title: Re: Calculating the distance between stars
Post by: KennyR on July 21, 2004, 07:03:02 PM
@Karlos

I just put it in c:ev as-is (replacing ² for ^2 of course). It's usually good at precedences. Not this time though. :)

Ok, so Blobrana was very close with the 2D trick. Seems her maths works too.
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 07:03:32 PM
Hum,
i cant check it using my head
but that is in the right magnatude and what i`d expect
Title: Re: Calculating the distance between stars
Post by: Karlos on July 21, 2004, 07:03:51 PM
Note that blobrana's solution is *very* sensetive to the accuracy of the angle subtended (since it is a factor in the last term of the expression).

I think, within the accuracy of measure 799 and 807 are in close enough agreement.
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 08:14:17 PM
@kennyR

Ahhh!
error

>>Betelgeuse is 650 ly from Earth, Rigel is 1400 ly.

Where on earth did you get those figures?


Well, i`ve just `flow` there, and the real distances are
Betelgeuse 427.480ly
Rigel      772.907ly

And from my spaceship porthole, at Rigel, i can see that Betelgeuse  is 392 ly away....


Is this the reason that the invasion fleet hasn`t arrived here KennyR? Hum?
Title: Re: Calculating the distance between stars
Post by: Karlos on July 21, 2004, 08:32:22 PM
Well the figures may be wrong but the agreement between the methods is what matters here :-D
Title: Re: Calculating the distance between stars
Post by: KennyR on July 21, 2004, 08:32:45 PM
Quote
Blobrana wrote:
Where on earth did you get those figures?


An advanced scientific method. First I put the text "betelguese distance" into google and took the first distance that appeared. In this case it was

Betelguese > Earth (http://www.noblemind.com/search.exe?keyword=Betelgeuse+Distance+from+Earth&var=1)
Betelgeuse is ~1400 light years from Earth, Betelgeuse. BV Color. Common Names.
Constellation. Coordinates. Distance from Earth. Harvard Revised Number. ...

And for Rigel, more of the same.

Try it yourself. =)
Title: Re: Calculating the distance between stars
Post by: blobrana on July 21, 2004, 08:36:13 PM
HHum,
google is obviously hiding something...the truth...

trust me,
i`ve been there...
have a deeper look...

Perhaps goofle has been `infected`?

----------------------------------------
i `m off to check --->


hum, yea...
try the revised distance
see! (http://en.wikipedia.org/wiki/Betelgeuse)
Title: Re: Calculating the distance between stars
Post by: Cymric on July 21, 2004, 11:12:56 PM
Okay, looks I made a few errors---it is a well-known fact engineers cannot calculate things properly ;-). First of all, Blobrana's method of Pyhtagoras-ing the angles and then applying the sine rule is simple and valid, of course. Second---and much more serious---I made an error in the conversion formula: in the expression for P_y the cos(g) should of course read sin(g). (It was very nice to enter a few numbers which mysteriously did not lie a distance 1 away from the origin in Cartesian coordinates, even though that is what I put them at in spherical ones...) Apologies all around. Third correction is that in order to use the astronomical values as given by Blobrana, you need to convert the value of f as well: negate the value before use. Astronomers use a left-handed system *sigh*. Also nice to track down.

So, to give a number example to calculate the angle subtended the hard way: Betelgeuse and Rigel are reported at 88.75 RA, 7 DE; and 77.5 RA, -8 DE; convert that to -88.75, 83; and -77.5, 98 degrees and plug those values into the corrected formulas. You end up with Cartesian coordinates (0.02165, -0.9923, 0.1218) for Betelgeuse and (0.2143, -0.9668, -0.1392) for Rigel---note that for now we do not need to know their distances to the Sun, as we're interested in the angle only, and that is independent of the distance. We can assume those to be 1 for convenience. Vector algebra will then tell you that the inner product of these two vectors equals the cosine of the angle subtended (times the length of both vectors, which is 1, hurray), and if I do the math, I end up with an angle of 18.7 degrees. Which is exactly equal to what you end up with following Blobrana's Pythagoras-approach.

Now I know why we are not taught spherical geometry :-D.
Title: Re: Calculating the distance between stars
Post by: blobrana on July 22, 2004, 12:09:14 AM
Hum,

So i use a quick mental check to see if the onboard computer hasn't gone mad:
Let’s see...
We have the angle 18 degrees (near enough to 20 degrees and a third of 60 degrees , which is a  isosceles triangle  , with 3 equal sides...
Betelgeuse 427
Rigel 772

772-427=345 (so it must be bigger than that)

Now this is where you use the (other) rough Pythagoras/trig  calculation

One side of the triangle (at right angle) is 345^2 = 119025
The base line (guessed/work from the angle, a third of 427 ) is (say) 142 light years
142 *142 = 20164
119025 +20164 = 139189


Sqr139189 = 373 light years...
Which is pretty close to my spaceships odometer....

(er, only 19 light years out -  ok so you wouldn`t risk a hyperjump with it but its a rough guide)



Title: Re: Calculating the distance between stars
Post by: Cymric on July 22, 2004, 08:22:50 AM
With the cosine rule

    a^2 = b^2 + c^2 - 2 b c cos \alpha

with b = 427 ly, c = 772 ly, and \alpha 18.7 degrees, I calculate the distance a to be 392.2 ly. Funny how a constellation turns out not to be 'flat' even though we perceive it as such.

In any case, this solves Kenny's problem.
Title: Re: Calculating the distance between stars
Post by: FluffyMcDeath on July 22, 2004, 05:12:24 PM
Hey Kenny...

I've found a website that has a database of stars and can give you pretty much instantly the distance between any two stars you can name.

Try it (http://oracleofbacon.org/oracle/star_links.html) yourself.
Title: Re: Calculating the distance between stars
Post by: T_Bone on July 22, 2004, 06:34:44 PM
Quote

blobrana wrote:
Hum,
To figure it roughly don't bother with Spherical trigonometry,
Just use standard 2d coordinates with Pythagoras theorem...


Lol, that's what I was going to say for about half a second after I read the original question, then I realised it wouldn't work and I was too lazy to put any more thought into it  :-P

It'll be close sometimes if the stars are on the same side of the sun, but falls all to hell once you try using it for stars on the other side. :-)
Title: Re: Calculating the distance between stars
Post by: blobrana on July 22, 2004, 07:59:52 PM
hum,
>> but falls all to hell

Yeah, using the rough mental method, it would, but it'll be within the right magnitude,
If you didn't have a calculator with cosine on it (er, like me), and just to verify that the cosine-rule calculation (see my other post) did produce a meaningful result...

The important thing is that it is all on one plane, so that the rough and accurate method work...




[Anyway I've got a spaceship that does that all for me...]
[go on, ask me the distance between two stars...any stars...]
 :-)
Title: Re: Calculating the distance between stars
Post by: mpiva on July 29, 2004, 10:55:40 PM
  Go to:

http://www.projectrho.com/starmap.html

It explains all this stuff in great detail with a step-by-step explaination of how to do the calculations.
Title: Re: Calculating the distance between stars
Post by: blobrana on July 29, 2004, 11:32:15 PM
Hum,
a nice link...

I'll peruse that one later...