Welcome, Guest. Please login or register.

Author Topic: Calculating the distance between stars  (Read 10967 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Calculating the distance between stars
« 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))...
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Calculating the distance between stars
« Reply #1 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).
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Calculating the distance between stars
« Reply #2 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 :-)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Calculating the distance between stars
« Reply #3 on: July 21, 2004, 06:53:32 PM »
@blob

That's what I mean :-)

x = 807 light years.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Calculating the distance between stars
« Reply #4 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)))
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Calculating the distance between stars
« Reply #5 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.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Calculating the distance between stars
« Reply #6 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
int p; // A