# How to calculate position of an unknown star knowing positions of some other stars from an image?

Suppose I know the coordinates (right ascension and declination) of the stars marked with red. How should I calculate the coordinates of an unknown star, marked with yellow?

Searching over the web, I found a technique called least squares plate constants. I guess plate constants dates back before CCD cameras. Unfortunately there was only little explanation. However, if I understood the matter correctly, I should assume the stars are on a surface of a sphere imaged to a plane? Please help :)

Also, how should I calculate the distances between the stars?

The original image is from Wikipedia.

• From what I understand, you are asking about the mathematical way of solving this. In any case, I'd just like to mention the astrometry.net service, this is what your sample image returns: nova.astrometry.net/user_images/645418#annotated – Gabriel Apr 19 '15 at 14:43
• For a tight field like the one in that picture, you can assume right ascension and declination are linear. For a more accurate answer (especially for wide field photography), see photo.stackexchange.com/questions/6111/… – barrycarter Apr 23 '15 at 17:25

First, let assume your image geometry is homogeneous, and has no peculiar distorsion in either direction.

Second, let assume you have the resolution of your image: the number of arcseconds / pixel.

Now, take one 'red-cross' star, call it A. It will be the origin of the triangle we will draw. Name your 'yellow-cross' star B. Now, take a new point, called 'C', that is at the same pixel-y coordinate of A, and the same pixel-x coordinates of B.

Drawing lines between A, B and C gives you a right triangle. You cannot simply apply flat geometry equations, since you are on the celestial sphere.

Hence, one must compute the 'Bearing' angle between A, B and C. See for instance here: (A bearing is an angle, measured clockwise from the north direction).

Here is a little piece of code you should be able to read:

double adjacent = sqrt(pow(B.x-C.x, 2) + pow(B.y-C.y, 2)); // dBC
double opposite = sqrt(pow(A.x-C.x, 2) + pow(A.y-C.y, 2)); // dAC



theta is the bearing angle, here expressed in degrees, thanks to the conversion constant ONE_RAD_IN_DEGREES. atan2 is the Arc-Tangent function that takes care of which quadrant you are in (it computes arctangent(opposite / adjacent), correcting for the quadrant, see the wikipedia article for instance).

Now, depending on whether you have East to the left or not (astro images have East to the left usually), you need to correct your angle. Again this little piece of code:

BOOL eastLeft = <true or false>

if (B.x < A.x && B.y > A.y) {
theta = (eastLeft) ? theta : 360.0 - theta;
}
else if (B.x < A.x && B.y < A.y) {
theta = (eastLeft) ? 180.0 - theta : theta + 180.;
}
else if (B.x > A.x && B.y < A.y) {
theta = (eastLeft) ? theta + 180. : 180.0 - theta;
}
else if (B.x > A.x && B.y > A.y) {
theta = (eastLeft) ? 360.0 - theta : theta;
}


Now, we have the correct theta value. Now, compute the distance (below, in degrees) between A and B, and call it delta.

Assuming the R.A. and Declination of A are called lambda1 and phi1, you can compute the R.A. and Declination of C, lambda2 and phi2, using the formulae given in here, under the section "Destination point given distance and bearing from start point".

In my code:

double phi1 = declination_A * ONE_DEG_IN_RADIANS;
double lambda1 = rightAscension_A * ONE_HOUR_IN_RADIANS;

double delta = degrees * ONE_DEG_IN_RADIANS;
double theta = bearing * ONE_DEG_IN_RADIANS;

double phi2 = asin(sin(phi1)*cos(delta) + cos(phi1)*sin(delta)*cos(theta));
double lambda2 = lambda1 + atan2(sin(theta) * sin(delta) * cos(phi1), cos(delta) - sin(phi1) * sin(phi2));


with the usual meaning of trigonometric functions (sin is sine, asin is arcsine, etc).

You need at least two images from same objects in diferent angle or position for generate a depth to calculate position, or same image position in diferent dates and a possible object aditional in image , in other way , any calculatiion is wrong

This may seem like a cheat, but why not just look up the star in a catalogue, or using one of the several free astronomy planetarium type apps - eg Stellarium, Cartes du Ciel etc. The star in question, nor any one is likely to find, is not unknown.