blob: 4bcc07885a3538a45d5223e1f0870d013b6a863d (
plain)
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
|
#pragma once
#ifdef new
#undef new
#endif
// We do not define _USE_MATH_DEFINES - please add your constants below.
#include <cmath>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using std::abs;
using std::cos;
using std::isfinite;
using std::sin;
using std::log10;
namespace math
{
double constexpr pi = 3.14159265358979323846;
double constexpr pi2 = pi / 2.;
double constexpr pi4 = pi / 4.;
double constexpr twicePi = 2. * pi;
template <class T> T sqr(T t) { return (t*t); }
}
|