//struct point rotateCoordinateSystem(struct point P, double theta);
inline
struct point rotateCoordinateSystem(struct point P, double theta)
{
struct point Q;
Q.x = P.x*cos(theta) + P.y*sin(theta);
Q.y = P.y*cos(theta) - P.x*sin(theta);
return(Q);
}
/** gradient **/
struct point module_potentialDerivatives_totalGradient(const int nhalos, const struct point *pImage, const struct Potential *lens);
struct point module_potentialDerivatives_totalGradient_SOA(const struct point *pImage, const struct Potential_SOA *lens, int shalos, int nhalos);
//struct point potentialDerivatives_totalGradient(const runmode_param *runmode, const struct point *pImage, const struct Potential *lens, int nhalos);
//struct point potentialDerivatives_totalGradient_SOA(const runmode_param *runmode, const struct point *pImage, const struct Potential *lens, int nhalos);
//
struct point grad_halo(const struct point *pImage, const struct Potential *lens);
//
/** PIEMD **/
complex piemd_1derivatives_ci05(double x, double y, double eps, double rc);