1 /* 2 * This library is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU Lesser General Public 4 * License as published by the Free Software Foundation; either 5 * version 2 of the License, or (at your option) any later version. 6 * 7 * This library is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 * Lesser General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software 14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 * 16 * Copyright (C) 2000 - 2005 Liam Girdwood <lgirdwood@gmail.com> 17 */ 18 19 module nova.apparent_position; 20 21 import nova.proper_motion; 22 import nova.aberration; 23 import nova.precession; 24 import nova.nutation; 25 import nova.ln_types; 26 27 extern (C) { 28 29 /* 30 ** Apparent place of an Object 31 */ 32 33 /*! \fn void ln_get_apparent_posn(struct ln_equ_posn *mean_position, struct ln_equ_posn *proper_motion, double JD, struct ln_equ_posn *position) 34 * \param mean_position Mean position of object, epoch J2000 35 * \param proper_motion Proper motion of object 36 * \param JD Julian Day 37 * \param position Pointer to store new object position 38 * 39 * Calculate the apparent equatorial position of a star from its mean equatorial position. 40 * This function takes into account the effects of proper motion, precession, nutation, 41 * annual aberration when calculating the stars apparent position. The effects of annual 42 * parallax and the gravitational deflection of light (Einstein effect) are NOT used 43 * in this calculation. 44 * 45 * This function assumes that the star's mean position is given as of J2000. 46 * At present, libnova does not support other epochs. 47 */ 48 @nogc void ln_get_apparent_posn(const ref ln_equ_posn mean_position, 49 const ref ln_equ_posn proper_motion, double JD, ref ln_equ_posn position) nothrow 50 { 51 ln_equ_posn proper_position; 52 ln_equ_posn aberration_position; 53 ln_equ_posn precession_position; 54 55 ln_get_equ_pm( 56 mean_position, proper_motion, JD, proper_position); 57 ln_get_equ_aber(proper_position, JD, aberration_position); 58 ln_get_equ_prec(aberration_position, JD, precession_position); 59 ln_get_equ_nut(precession_position, JD, position); 60 } 61 62 }