48 virtual const std::string
classname() {
return "a_point2";}
49 static const std::string
help();
52 inline double x()
const {
return x_; }
53 inline double y()
const {
return y_; }
54 inline double operator[](
const int i)
const {
if (i==0)
return x_;
if (i==1)
return y_; exit(1);
return x_;}
57 inline void x(
double v) {
x_ = v; }
58 inline void y(
double v) {
y_ = v; }
64 inline double&
operator[](
const int i) {
if (i==0)
return x_;
if (i==1)
return y_; exit(1);
return x_;}
78 inline double dist(
const a_point2& p)
const {
return (p-*
this).norm();}
82 virtual void read(std::istream &i);
83 virtual void write(std::ostream &o)
const;
double angle(const a_point2 &a, const a_point2 &b)
a_point2 average_rot(const a_point2 &a, const a_point2 &b, double f=0.5)
a_point2 operator+(const a_point2 &a, const a_point2 &b)
double operator*(const a_point2 &a, const a_point2 &b)
a_point2 operator/(const a_point2 &a, double v)
a_point2 operator-(const a_point2 &a, const a_point2 &b)
double dist(const a_point2 &a, const a_point2 &b)
a_point2 average(const a_point2 &a, const a_point2 &b, double f=0.5)
a_point2 & translate(double x, double y)
double operator[](const int i) const
a_point2 & operator-=(const a_point2 &)
static const std::string help()
a_point2 & operator+=(const a_point2 &)
double operator*=(const a_point2 &)
a_point2(const double x[2])
a_point2 & operator=(const a_point2 &p)
virtual void write(std::ostream &o) const
virtual const std::string classname()
double dist(const a_point2 &p) const
a_point2 & operator/=(const a_point2 &)
virtual void read(std::istream &i)
a_point2(const a_point2 &p)
a_point2 & rotate(const double angle)
a_point2(const float x[2])
bool operator==(const a_point2 &p)
void set(double x, double y)
a_point2(double x, double y)
double & operator[](const int i)
a_point2 & operator/=(double v)