ephcom_wrapper.hpp 1.46 KB
Newer Older
Zhang Xin's avatar
Zhang Xin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include "ephcom.h"

/*
#define EPHCOM_MERCURY       1
#define EPHCOM_VENUS         2
#define EPHCOM_EARTH         3
#define EPHCOM_MARS          4
#define EPHCOM_JUPITER       5
#define EPHCOM_SATURN        6
#define EPHCOM_URANUS        7
#define EPHCOM_NEPTUNE       8
#define EPHCOM_PLUTO         9
#define EPHCOM_MOON          10    // Moon, relative to Solar System center
#define EPHCOM_SUN           11
*/


#ifndef _EPHCOM_WRAPPER_HPP_
#define _EPHCOM_WRAPPER_HPP_

#define SUN		EPHCOM_SUN		// 太阳
#define MOON	EPHCOM_MOON		// 月球
#define PLUTO	EPHCOM_PLUTO	// 冥王星
#define NEPTUNE EPHCOM_NEPTUNE	// 海王星
#define URANUS  EPHCOM_URANUS	// 天王星
#define SATURN  EPHCOM_SATURN	// 土星
#define JUPITER EPHCOM_JUPITER	// 木星
#define MARS	EPHCOM_MARS		// 火星
#define EARTH	EPHCOM_EARTH	// 地球
#define VENUS	EPHCOM_VENUS	// 金星
#define MERCURY EPHCOM_MERCURY	// 水星


class Ephcom{
private:
    FILE *infp;
    ephcom_Header header;
	ephcom_Coords coords;
	int ORIG;			// origin used to calculation positions of Sun, Moon and planets. Default: EPHCOM_EARTH
public:

Zhang Xin's avatar
Zhang Xin committed
46
	Ephcom();
Zhang Xin's avatar
Zhang Xin committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    ~Ephcom();

    void init(std::string& DE_filename);

	// get position and velocity
	/*
		targ: one of the object, SUN, ..., MERCURY
		jd  : Julian date
		pos : position of the object
		vel : velocity of the object
	*/

	void getPosVel(int targ, double jd, double pos[3], double vel[3]);
};


#endif