GeographicLib: AuxAngle.cpp Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

19

21

22 using namespace std;

23

27

29 using std::isnan;

30 if ( isnan( tan() ) ||

31 (fabs(_y) > numeric_limits::max()/2 &&

32 fabs(_x) > numeric_limits::max()/2) )

33

34

35 return NaN();

36 real r = hypot(_y, _x),

37 y = _y/r, x = _x/r;

38

39 if (isnan(y)) y = copysign(real(1), _y);

40 if (isnan(x)) x = copysign(real(1), _x);

42 }

43

45 return AuxAngle(copysign(y(), p.y()), copysign(x(), p.x()));

46 }

47

49

50 if (p.tan() != 0) {

51 real x = _x * p._x - _y * p._y;

52 _y = _y * p._x + _x * p._y;

53 _x = x;

54 }

55 return *this;

56 }

57

58}

Header for the GeographicLib::AuxAngle class.

An accurate representation of angles.

AuxAngle normalized() const

Definition AuxAngle.cpp:28

AuxAngle & operator+=(const AuxAngle &p)

Definition AuxAngle.cpp:48

static AuxAngle NaN()

Definition AuxAngle.cpp:24

AuxAngle copyquadrant(const AuxAngle &p) const

Definition AuxAngle.cpp:44

AuxAngle(real y=0, real x=1)

Namespace for GeographicLib.