Commits
Akeem Wells authored 8cc9d04377f Merge
43 43 | { |
44 44 | if(units == "Rad" || units == "RAD" || units == "rad") { |
45 45 | valueIS_ = angle; |
46 46 | } else if(units == "deg" || units == "DEG") { |
47 47 | valueIS_ = (angle / 360.0) * 6.2831852; |
48 48 | } else { |
49 49 | valueIS_ = angle; |
50 50 | } |
51 51 | } |
52 52 | |
53 + | Angle::Angle(double angle, Angle::Units units) |
54 + | { |
55 + | if(units == Angle::UnitRadian) { |
56 + | valueIS_ = angle; |
57 + | } else if(units == Angle::UnitDegree) { |
58 + | valueIS_ = (angle / 360.0) * 6.2831852; |
59 + | } else { |
60 + | valueIS_ = angle; |
61 + | } |
62 + | } |
63 + | |
53 64 | Angle::~Angle() |
54 65 | { |
55 66 | } |
56 67 | |
57 68 | double Angle::get(const std::string &units) const |
58 69 | { |
59 70 | if(units == "Rad" || units == "RAD" || units == "rad") { |
60 71 | return valueIS_; |
61 72 | } else if(units == "deg" || units == "DEG") { |
62 73 | return 360.0 * (valueIS_ / 6.2831852); |
63 74 | } else { |
64 75 | return valueIS_; |
65 76 | } |
66 77 | } |
67 78 | |
79 + | double Angle::get(Angle::Units units) const |
80 + | { |
81 + | if(units == Angle::UnitRadian) { |
82 + | return valueIS_; |
83 + | } else if(units == Angle::UnitDegree) { |
84 + | return 360.0 * (valueIS_ / 6.2831852); |
85 + | } else { |
86 + | return valueIS_; |
87 + | } |
88 + | } |
89 + | |
68 90 | ATM_NAMESPACE_END |