5#include "polarpointf.h"
9#include "helperposixmath.h"
25PolarPointF::PolarPointF(
const double newRadius,
const double newAngleDegree)
26 : m_angleDegree(newAngleDegree)
29 normalizePolar360(m_radius, m_angleDegree);
40PolarPointF::PolarPointF(
const QPointF cartesianCoordiantes)
43 pow(cartesianCoordiantes.
x(), 2) + pow(cartesianCoordiantes.
y(), 2));
54 if (cartesianCoordiantes.
y() >= 0) {
55 m_angleDegree = qRadiansToDegrees(
56 acos(cartesianCoordiantes.
x() / m_radius));
58 m_angleDegree = qRadiansToDegrees(
59 2 * pi - acos(cartesianCoordiantes.
x() / m_radius));
72bool PolarPointF::isSamePoint(
const PolarPointF other)
const
76 (m_radius == other.m_radius) &&
79 ((m_angleDegree == other.m_angleDegree) || (m_radius == 0)));
85double PolarPointF::radius()
const
94double PolarPointF::angleDegree()
const
102QPointF PolarPointF::toCartesian()
const
104 return QPointF(m_radius * cos(qDegreesToRadians(m_angleDegree)),
105 m_radius * sin(qDegreesToRadians(m_angleDegree)));
119 <<
"PolarPointF(radius: "
122 << value.angleDegree()
127static_assert(std::is_trivially_copyable_v<PolarPointF>);
130static_assert(std::is_standard_layout_v<PolarPointF>);
132static_assert(std::is_default_constructible_v<PolarPointF>);
134static_assert(std::is_nothrow_default_constructible_v<PolarPointF>);
136static_assert(std::is_copy_constructible_v<PolarPointF>);
137static_assert(std::is_trivially_copy_constructible_v<PolarPointF>);
138static_assert(std::is_nothrow_copy_constructible_v<PolarPointF>);
140static_assert(std::is_move_constructible_v<PolarPointF>);
141static_assert(std::is_trivially_move_constructible_v<PolarPointF>);
142static_assert(std::is_nothrow_move_constructible_v<PolarPointF>);
QDebug operator<<(QDebug dbg, const DcrawInfoContainer &c)
The namespace of this library.