Changeset 4540 for trunk/psLib/src/astronomy/psCoord.h
- Timestamp:
- Jul 12, 2005, 9:12:01 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astronomy/psCoord.h (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psCoord.h
r4401 r4540 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 6-27 20:38:11$12 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-12 19:12:00 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psList.h" 25 25 #include "psFunctions.h" 26 #include "psTime.h" 26 // N.B. inclusion of psTime.h was done to after the typedefs to handle cross-dependency of typedefs 27 27 28 28 /// @addtogroup CoordinateTransform … … 38 38 typedef struct 39 39 { 40 double x; ///< x position41 double y; ///< y position42 double xErr; ///< Error in x position43 double yErr; ///< Error in y position40 double x; ///< x position 41 double y; ///< y position 42 double xErr; ///< Error in x position 43 double yErr; ///< Error in y position 44 44 } 45 45 psPlane; … … 52 52 * 53 53 */ 54 typedef struct psSphere55 { 56 double r; ///< RA57 double d; ///< Dec58 double rErr; ///< Error in RA59 double dErr; ///< Error in Dec54 typedef struct 55 { 56 double r; ///< RA 57 double d; ///< Dec 58 double rErr; ///< Error in RA 59 double dErr; ///< Error in Dec 60 60 } 61 61 psSphere; 62 63 /** Cubic Coordinate System 64 * 65 */ 66 typedef struct 67 { 68 double x; ///< cos (DEC) cos (RA) 69 double y; ///< cos (DEC) sic (RA) 70 double z; ///< sin (DEC) 71 double xErr; ///< Error in x 72 double yErr; ///< Error in y 73 double zErr; ///< Error in z 74 } 75 psCube; 76 77 /** Spherical rotations represent coordinate transformation in 3-D, as well as 78 * the effects of precession and nutation. The structure contains the 79 * elements of a quaternion to represent the spherical rotational. 80 * 81 */ 82 typedef struct 83 { 84 double q0; ///< first element of the quaternion 85 double q1; ///< second element of the quaternion 86 double q2; ///< third element of the quaternion 87 double q3; ///< fourth element of the quaternion 88 } 89 psSphereRot; 62 90 63 91 /** 2D Polynomial Transform … … 94 122 } 95 123 psPlaneDistort; 96 97 /** Spherical Transform Definition98 *99 * We need to be able to convert between ICRS, Galactic and Ecliptic100 * coordinates, and potentially between arbitrary spherical coordinate101 * systems. All of these basic spherical transformations represent rotations102 * of the spherical coordinate reference. We specify a general103 * transformation function which takes a structure, psSphereTransform,104 * defining the transformation between two spherical coordinate systems105 *106 */107 typedef struct108 {109 double alphaP; ///< Longitude of the target system pole in the source system110 double cosDeltaP; ///< Cosine of target pole latitude in the source system111 double sinDeltaP; ///< Sine of target pole latitude in the source system112 double phiP; ///< Longitude of the ascending node in the target system113 }114 psSphereTransform;115 124 116 125 /** Projection type for projection/deprojection … … 167 176 } psSphereOffsetUnit; 168 177 178 #include "psTime.h" 179 169 180 /** Allocates a psPlane 170 181 * … … 178 189 * @return psSphere* resulting sphere structure. 179 190 */ 180 181 191 psSphere* psSphereAlloc(void); 182 192 193 /** psSphereRot allocator which defines the rotation in terms of the coordinate 194 * of the pole and the rotation about that pole. 195 * 196 * @return psSphereRot* Newly allocated psSphereRot object 197 */ 198 psSphereRot* psSphereRotAlloc( 199 double alphaP, 200 double deltaP, 201 double phiP 202 ); 203 204 /** psSphereRot allocator which defines the rotation from the elements of the 205 * quaternion. 206 * 207 * @return psSphereRot* Newly allocated psSphereRot object 208 */ 209 psSphereRot* psSphereRotQuat( 210 double q0, 211 double q1, 212 double q2, 213 double q3 214 ); 183 215 184 216 /** Allocates a psPlaneTransform transform. … … 186 218 * @return psPlaneTransform* resulting plane transform 187 219 */ 188 189 220 psPlaneTransform* psPlaneTransformAlloc( 190 221 int n1, ///< The order of the x term in the transform. … … 227 258 ); 228 259 229 /** Allocator for psSphereTransform 230 * 231 * @return psSphereTransform* newly allocated struct 232 */ 233 234 psSphereTransform* psSphereTransformAlloc( 235 double alphaP, ///< north pole latitude 236 double deltaP, ///< north pole longitude? 237 double phiP ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares). 238 ); 239 240 /** Applies the psSphereTransform transform for a specified coordinate 260 261 /** Applies the psSphereRot transform for a specified coordinate 241 262 * 242 263 * @return psSphere* resulting coordinate based on transform 243 264 */ 244 psSphere* psSphere TransformApply(265 psSphere* psSphereRotApply( 245 266 psSphere* out, ///< a psSphere to recycle. If NULL, a new one is generated. 246 const psSphere Transform* transform,///< the transform to apply267 const psSphereRot* transform, ///< the transform to apply 247 268 const psSphere* coord ///< the coordinate to apply the transform above.x 269 ); 270 271 /** Combines two rotations to produce a single rotation which is equivalent of 272 * applying the first rotation and then the second. 273 * 274 * @return psSphereRot* new psSphereRot transform 275 */ 276 psSphereRot* psSphereRotCombine( 277 psSphereRot* out, 278 const psSphereRot* rot1, 279 const psSphereRot* rot2 280 ); 281 282 /** Inverts a psSphereRot's rotation. 283 * 284 * @return psSphereRot* The inverted psSphereRot 285 */ 286 psSphereRot* psSphereRotInvert( 287 psSphereRot* rot ///< the psSphereRot to invert 248 288 ); 249 289 … … 251 291 * coordinate systems. 252 292 * 253 * @return psSphere Transform*transform for ICRS->Ecliptic coordinate systems254 */ 255 psSphere Transform* psSphereTransformICRSToEcliptic(256 psTime *time///< the time for which the resulting transform will be valid293 * @return psSphereRot* transform for ICRS->Ecliptic coordinate systems 294 */ 295 psSphereRot* psSphereRotICRSToEcliptic( 296 const psTime* time ///< the time for which the resulting transform will be valid 257 297 ); 258 298 … … 260 300 * coordinate systems. 261 301 * 262 * @return psSphere Transform*transform for Ecliptic->ICRS coordinate systems263 */ 264 psSphere Transform* psSphereTransformEclipticToICRS(265 psTime *time///< the time for which the resulting transform will be valid302 * @return psSphereRot* transform for Ecliptic->ICRS coordinate systems 303 */ 304 psSphereRot* psSphereRotEclipticToICRS( 305 const psTime* time ///< the time for which the resulting transform will be valid 266 306 ); 267 307 … … 270 310 * 271 311 */ 272 psSphere Transform* psSphereTransformICRSToGalactic(void);312 psSphereRot* psSphereRotICRSToGalactic(void); 273 313 274 314 /** Creates the appropriate transform for converting from Galactic to ICRS … … 276 316 * 277 317 */ 278 psSphere Transform* psSphereTransformGalacticToICRS(void);318 psSphereRot* psSphereRotGalacticToICRS(void); 279 319 280 320 /** Allocates memory for a psProjection structure
Note:
See TracChangeset
for help on using the changeset viewer.
