polar2d.cpp
Go to the documentation of this file.
1 #include <memory>
2 #include <tuw_geometry/polar2d.h>
3 
4 using namespace tuw;
5 
6 Polar2D::Polar2D () : Point2D ( 0,0 ) {};
7 Polar2D::Polar2D ( const Point2D &p ) : Point2D ( atan2( p.y(), p.x()), sqrt( p.x() * p.x() + p.y()* p.y() ), 1 ) {};
8 Polar2D::Polar2D ( double alpha, double rho ) : Point2D ( alpha,rho ) {};
9 Polar2D::Polar2D ( double alpha, double rho, double h ) : Point2D ( alpha, rho, h ) {};
10 
14 const double &Polar2D::alpha () const {
15  return x();
16 }
20 double &Polar2D::alpha () {
21  return x();
22 }
26 const double &Polar2D::rho () const {
27  return y();
28 }
32 double &Polar2D::rho () {
33  return y();
34 }
39  return Point2D(cos(alpha()) * rho(), sin(alpha()) * rho());
40 }
const double & y() const
Definition: point2d.cpp:49
const double & rho() const
Definition: polar2d.cpp:26
const double & h() const
Definition: point2d.cpp:63
const double & alpha() const
Definition: polar2d.cpp:14
Definition: command.h:8
const double & x() const
Definition: point2d.cpp:35
Point2D point() const
Definition: polar2d.cpp:38


tuw_geometry
Author(s): Markus Bader
autogenerated on Mon Jun 10 2019 15:33:09