MCPcopy Create free account
hub / github.com/LimHyungTae/patchwork / xy2theta

Method xy2theta

include/patchwork/patchwork.hpp:777–788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775
776template <typename PointT>
777inline double PatchWork<PointT>::xy2theta(const double &x,
778 const double &y) { // 0 ~ 2 * PI
779 /*
780 if (y >= 0) {
781 return atan2(y, x); // 1, 2 quadrant
782 } else {
783 return 2 * M_PI + atan2(y, x);// 3, 4 quadrant
784 }
785 */
786 auto atan_value = atan2(y, x); // EDITED!
787 return atan_value > 0 ? atan_value : atan_value + 2 * M_PI; // EDITED!
788}
789
790template <typename PointT>
791inline double PatchWork<PointT>::xy2radius(const double &x, const double &y) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected