#include "BaseConstVariable.h"
#include "GPUTool.cuh"
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <cublas_v2.h>
#include <cuComplex.h>
#include "GPUTool.cuh"


#define WGS84_A 6378137.0       // ³¤°ëÖá (m)
#define WGS84_F (1.0/298.257223563)
#define WGS84_B (WGS84_A*(1-WGS84_F)) // ¶Ì°ëÖá (m)
#define EPSILON 1e-12
#define MAX_ITER 50
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

//extern __device__ __host__ Vector3 vec_sub(Vector3 a, Vector3 b);
//extern __device__ __host__ double vec_dot(Vector3 a, Vector3 b);
//extern __device__ __host__ Vector3 vec_normalize(Vector3 v);
extern __device__ __host__ Vector3 compute_T(Vector3 S, Vector3 ray_dir, double H);
extern __device__ __host__ void compute_basis(Vector3 S, Vector3 T, Vector3* e1, Vector3* e2);
extern __device__ __host__ int newton_solve(Vector3 S, Vector3 e1, Vector3 e2, double R, double H, double* u, double* v);
extern __device__ __host__ Vector3 compute_P(Vector3 S, Vector3 T, double R, double H);



