51 virtual const std::string
classname() {
return "a_point";}
52 static const std::string
help();
54 inline double x()
const {
return x_; }
55 inline double y()
const {
return y_; }
56 inline double z()
const {
return z_; }
57 inline double operator[](
const int i)
const {
if (i==0)
return x_;
if (i==1)
return y_;
if (i==2)
return z_; exit(1);
return x_;}
60 inline void x(
double v) {
x_ = v; }
61 inline void y(
double v) {
y_ = v; }
62 inline void z(
double v) {
z_ = v; }
68 inline void set_spherical(
double r,
double th,
double ph) {
x_ = r*cos(th)*cos(ph);
y_ = r*cos(th)*sin(ph);
z_ = r*sin(th);}
73 inline double&
operator[](
const int i) {
if (i==0)
return x_;
if (i==1)
return y_;
if (i==2)
return z_; exit(1);
return x_;}
96 inline double dist(
const a_point& p)
const {
return (p-*
this).norm();}
102 virtual void read(std::istream &i);
103 virtual void write(std::ostream &o)
const;
a_point operator-(const a_point &a, const a_point &b)
a_point operator+(const a_point &a, const a_point &b)
double angle(a_point a, a_point b)
a_point cross(const a_point &a, const a_point &b)
a_point average_rot(const a_point &a, const a_point &b, double f=0.5)
a_point circle_centre(const a_point &, const a_point &, const a_point &)
double dist(const a_point &a, const a_point &b)
a_point average(const a_point &a, const a_point &b, double f=0.5)
a_point operator/(const a_point &a, double v)
double operator*(const a_point &a, const a_point &b)
a_point(const a_point &p)
a_point & operator-=(const a_point &)
a_point operator+(const a_point &)
a_point & operator+=(const a_point &)
a_point(const double x[3])
a_point(const float x[3])
a_point & operator=(const a_point &p)
bool operator==(const a_point &p) const
bool operator!=(const a_point &p) const
a_point & rotate(const a_point &x_axis, const a_point &y_axis, const a_point &z_axis)
a_point(double x, double y, double z)
a_point cross(const a_point &) const
void set(double x, double y, double z)
void set_spherical(double r, double th, double ph)
static const std::string help()
a_point & operator/=(double v)
a_point & translate(double x, double y, double z)
a_point & operator/=(const a_point &)
void set_cylindrical(double r, double a, double h)
double dist(const a_point &p) const
virtual const std::string classname()
virtual void write(std::ostream &o) const
double operator*=(const a_point &)
double operator*(const a_point &)
virtual void read(std::istream &i)
a_point & max()
set maximum abs value of component to 1.
double & operator[](const int i)
double operator[](const int i) const