MCPcopy Create free account
hub / github.com/Pamphlett/Outram / xy2theta

Method xy2theta

include/patchwork.hpp:528–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526
527template<typename PointT>
528inline
529double PatchWork<PointT>::xy2theta(const double &x, const double &y) { // 0 ~ 2 * PI
530 /*
531 if (y >= 0) {
532 return atan2(y, x); // 1, 2 quadrant
533 } else {
534 return 2 * M_PI + atan2(y, x);// 3, 4 quadrant
535 }
536 */
537 auto atan_value = atan2(y,x); // EDITED!
538 return atan_value > 0 ? atan_value : atan_value + 2*M_PI; // EDITED!
539}
540
541template<typename PointT>
542inline

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected