Projected Separation and 3D Distance Problem (Code Included)

  • Thread starter Thread starter FiberOptix
  • Start date Start date
  • Tags Tags
    3d Separation
AI Thread Summary
The discussion revolves around the calculation of projected separation and Euclidean distance between two galaxies using J2000 equatorial coordinates. The user notes that the projected separations, calculated via the Haversine formula, often exceed the Euclidean distances, which should not be the case. A key point raised is that projected separation assumes equal distances to both galaxies, which can lead to discrepancies when comparing distances. The validity of using the Haversine function for this purpose is questioned, suggesting that it may not be appropriate for comparing projected and Euclidean distances. Ultimately, the user acknowledges the need for clarification on their initial assumptions regarding distance measurements.
FiberOptix
Messages
12
Reaction score
0
Hi all, I've written code that takes J2000 equatorial coordinates for 2 objects and calculates (1) the projected separation of between object 1 and object 2 at the distance of object 1, and the Euclidean (3D) distance between objects 1 and 2. The projected separations should be <= the Euclidean distance, but most of the time they aren't. I've checked both formulae several times and am left scratching my head. As a last ditch effort, perhaps someone here can spot the error. Projected separations are calculated via the Haversine formula. See the C/C++ functions below, where I've included the struct:

Code:
typedef struct _galaxy{
	char Name[12];
	double RA, DE;
	double D;
} galaxy;

double separation (galaxy gal1, galaxy gal2)
{
  // convert from eq coords to Cartesian
  double x1 = gal1.D * cos(gal1.DE * DEG_TO_RAD) * cos(gal1.RA * DEG_TO_RAD);
  double x2 = gal2.D * cos(gal2.DE * DEG_TO_RAD) * cos(gal2.RA * DEG_TO_RAD);
  double y1 = gal1.D * cos(gal1.DE * DEG_TO_RAD) * sin(gal1.RA * DEG_TO_RAD);
  double y2 = gal2.D * cos(gal2.DE * DEG_TO_RAD) * sin(gal2.RA * DEG_TO_RAD);
  double z1 = gal1.D * sin(gal1.DE * DEG_TO_RAD);
  double z2 = gal2.D * sin(gal2.DE * DEG_TO_RAD);
  // compute 3d separation
  double out = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) );
  return out;
}

double proj_separation(galaxy gal1, galaxy gal2)
{
  double dDE = ( gal1.DE - gal2.DE ) * DEG_TO_RAD;
  double dRA = ( gal1.RA - gal2.RA ) * DEG_TO_RAD;
  // calculate projected separation of galaxy 2 at the distance of galaxy 1 (Haversine)
  double out = gal1.D * ( 2.0 * asin( 
                                sqrt( ( sin( dDE/2.0 ) * sin( dDE/2.0 ) ) 
                                    + ( cos( gal1.DE * DEG_TO_RAD ) 
                                       * cos( gal2.DE * DEG_TO_RAD )
                                       * sin( dRA / 2.0 )
                                       * sin( dRA / 2.0 )
			 	        ) ) ) ) ;
  return out;
}
 
Astronomy news on Phys.org
FiberOptix said:
The projected separations should be <= the Euclidean distance
Why?
Consider two galaxies at the same distance D to us, but separated by 90° (as seen by us).
Their Euclidian distance is ##D\sqrt{2}##, but if you project this distance on a great circle, you get ##D\frac{\pi}{2} > D\sqrt{2}##.
The 90° are arbitrary, the inequality holds for any angle.
 
mfb said:
Why?

Because a projected separation is calculated assuming the distances to each are the same. Any difference between the distances two is going to give a true separation that is greater than the projected one.

Consider two galaxies at the same distance D to us, but separated by 90° (as seen by us).
Their Euclidian distance is ##D\sqrt{2}##, but if you project this distance on a great circle, you get ##D\frac{\pi}{2} > D\sqrt{2}##.
The 90° are arbitrary, the inequality holds for any angle.

Yes, I think the difference here is that, by projected separation, I intend to mean projected distance between the two. I'm not sure that projecting on to a great circle is a valid thing to do. So, maybe I shouldn't be using the Haversine function...
 
Because a projected separation is calculated assuming the distances to each are the same.
As shown, you compare two different distance measurements, even if the distances to us are the same.

I'm not sure that projecting on to a great circle is a valid thing to do.
At least not if you want to compare it to the Euclidian distance.

You can calculate the Euclidian distance if you project the galaxy further away to the distance of the other galaxy. In that case, you should get a value which does not exceed the true separation.
 
mfb said:
As shown, you compare two different distance measurements

Right, this discussion has been helpful. I guess my initial assertion was incorrect and I can continue on but I'm still feeling a bit uneasy about it.
 
TL;DR Summary: In 3 years, the Square Kilometre Array (SKA) telescope (or rather, a system of telescopes) should be put into operation. In case of failure to detect alien signals, it will further expand the radius of the so-called silence (or rather, radio silence) of the Universe. Is there any sense in this or is blissful ignorance better? In 3 years, the Square Kilometre Array (SKA) telescope (or rather, a system of telescopes) should be put into operation. In case of failure to detect...
Thread 'Could gamma-ray bursts have an intragalactic origin?'
This is indirectly evidenced by a map of the distribution of gamma-ray bursts in the night sky, made in the form of an elongated globe. And also the weakening of gamma radiation by the disk and the center of the Milky Way, which leads to anisotropy in the possibilities of observing gamma-ray bursts. My line of reasoning is as follows: 1. Gamma radiation should be absorbed to some extent by dust and other components of the interstellar medium. As a result, with an extragalactic origin, fewer...
This thread is dedicated to the beauty and awesomeness of our Universe. If you feel like it, please share video clips and photos (or nice animations) of space and objects in space in this thread. Your posts, clips and photos may by all means include scientific information; that does not make it less beautiful to me (n.b. the posts must of course comply with the PF guidelines, i.e. regarding science, only mainstream science is allowed, fringe/pseudoscience is not allowed). n.b. I start this...

Similar threads

Replies
1
Views
2K
Replies
3
Views
2K
Replies
5
Views
6K
Replies
11
Views
6K
Replies
3
Views
13K
Replies
1
Views
2K
Back
Top