59 lines
845 B
C++
59 lines
845 B
C++
#ifndef _DATAFUNC_H
|
|
#define _DATAFUNC_H
|
|
#include "iostream"
|
|
#include "fstream"
|
|
#include "string.h"
|
|
#include "iomanip"
|
|
#include "cmath"
|
|
#include "stdio.h"
|
|
#include "stdlib.h"
|
|
#include "list"
|
|
|
|
#define G0 6.67259e-03
|
|
#define pi (4.0*atan(1.0))
|
|
#define MAX 1e+30
|
|
|
|
#define GRAV "-g"
|
|
#define GRADX "-x"
|
|
#define GRADY "-y"
|
|
#define GRADZ "-z"
|
|
#define RANGE "-r"
|
|
#define INTERVAL "-i"
|
|
#define PARAFILE "-f"
|
|
#define SPHERE "-s"
|
|
#define CUBE "-c"
|
|
#define OUTPUT "-o"
|
|
#define BOLDRED "\033[1m\033[31m"
|
|
#define RESET "\033[0m"
|
|
|
|
using namespace std;
|
|
|
|
double arctg(double v)
|
|
{
|
|
double ang;
|
|
if(v>=0)
|
|
{
|
|
ang=atan(v);
|
|
}
|
|
else if(v<0)
|
|
{
|
|
ang=atan(v)+pi;
|
|
}
|
|
return ang;
|
|
}
|
|
|
|
struct sphere
|
|
{
|
|
double x,y,z,r;
|
|
double density;
|
|
};
|
|
typedef list<sphere> SphereList;
|
|
|
|
struct cube
|
|
{
|
|
double x1,x2,y1,y2,z1,z2;
|
|
double density;
|
|
};
|
|
typedef list<cube> CubeList;
|
|
|
|
#endif |