src/utilities/geometry/EulerAngles.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "EulerAngles.hpp" | ||
| 7 | |||
| 8 | namespace openstudio { | ||
| 9 | |||
| 10 | /// default constructor with no rotation | ||
| 11 | ✗ | EulerAngles::EulerAngles() : m_storage(3, 0.0) {} | |
| 12 | |||
| 13 | /// constructor with psi, theta, phi | ||
| 14 | 1217 | EulerAngles::EulerAngles(double psi, double theta, double phi) : m_storage(3) { | |
| 15 |
1/1✓ Branch 1 taken 1217 times.
|
1217 | m_storage[0] = psi; |
| 16 |
1/1✓ Branch 1 taken 1217 times.
|
1217 | m_storage[1] = theta; |
| 17 |
1/1✓ Branch 1 taken 1217 times.
|
1217 | m_storage[2] = phi; |
| 18 | 1217 | } | |
| 19 | |||
| 20 | /// get psi | ||
| 21 | 1217 | double EulerAngles::psi() const { | |
| 22 | 1217 | return m_storage[0]; | |
| 23 | } | ||
| 24 | |||
| 25 | /// get theta | ||
| 26 | 1217 | double EulerAngles::theta() const { | |
| 27 | 1217 | return m_storage[1]; | |
| 28 | } | ||
| 29 | |||
| 30 | /// get phi | ||
| 31 | 1217 | double EulerAngles::phi() const { | |
| 32 | 1217 | return m_storage[2]; | |
| 33 | } | ||
| 34 | |||
| 35 | /// ostream operator | ||
| 36 | ✗ | std::ostream& operator<<(std::ostream& os, const EulerAngles& angles) { | |
| 37 | ✗ | os << "[" << angles.psi() << ", " << angles.theta() << ", " << angles.phi() << "]"; | |
| 38 | ✗ | return os; | |
| 39 | } | ||
| 40 | |||
| 41 | } // namespace openstudio | ||
| 42 |