## [Stellarium-pubdevel] Mathematics help wanted

 [Stellarium-pubdevel] Mathematics help wanted From: Matthew Gates - 2007-07-07 15:17:17 ```Hello all, I'm looking at adding rotate, scale and translate members to the AstroImage class, and my rusty mathematics skills are not up to the job. If someone can help me, it would be much appreciated. An AstroImage is created from a texture and the positions of four the corners of the image. The four corners are Vec3d's which are used to create a ConvexPolygon, whose state represents the position of the AstroImage. Question: How can I determine the rotation of the image against the celestial sphere from the ConvexPolygon Vec3d objects? Here's my proposed method. If you can tell me if I'm on the right track, that would be super: a) Determine the vector which points along the top of the image by subtracting the top-right point from the top-left point. I shall call this "T". b) Determine the vector which is congruent to the line of sight of the observer when looking at the image, and which points along the celestial equator (but how?). I shall call this "T". c) find the angle between T and E: c) i) calculate the unit vector of T, "Tu". c) ii) calculate the unit vector of E, "Eu". c) iii) use the dot product of Tu and Eu to get the angle, "A": Tu . Eu = cos A Would this method work? Am I missing something important? Is there a better way to do it? Am I barking up the wrong tree entirely? Cheers Matthew ```

 [Stellarium-pubdevel] Mathematics help wanted From: Matthew Gates - 2007-07-07 15:17:17 ```Hello all, I'm looking at adding rotate, scale and translate members to the AstroImage class, and my rusty mathematics skills are not up to the job. If someone can help me, it would be much appreciated. An AstroImage is created from a texture and the positions of four the corners of the image. The four corners are Vec3d's which are used to create a ConvexPolygon, whose state represents the position of the AstroImage. Question: How can I determine the rotation of the image against the celestial sphere from the ConvexPolygon Vec3d objects? Here's my proposed method. If you can tell me if I'm on the right track, that would be super: a) Determine the vector which points along the top of the image by subtracting the top-right point from the top-left point. I shall call this "T". b) Determine the vector which is congruent to the line of sight of the observer when looking at the image, and which points along the celestial equator (but how?). I shall call this "T". c) find the angle between T and E: c) i) calculate the unit vector of T, "Tu". c) ii) calculate the unit vector of E, "Eu". c) iii) use the dot product of Tu and Eu to get the angle, "A": Tu . Eu = cos A Would this method work? Am I missing something important? Is there a better way to do it? Am I barking up the wrong tree entirely? Cheers Matthew ```