20 #define COORD_TYPE float // type of point members
44 CPoint() { dimn = 3; x = y = z = 0; }
47 CPoint(
int a) { dimn = 1; x = (float) a; y = z = 0; }
48 CPoint(
float a) { dimn = 1; x = a; y = z = 0; }
49 CPoint(
double a) { dimn = 1; x = a; y = z = 0; }
52 CPoint(
int a,
int b) { dimn = 2; x = (float) a; y = (float) b; z = 0; }
57 CPoint(
int a,
int b,
int c) { dimn = 3; x = (float) a; y = (float) b; z = c; }
62 CPoint(PointMode m,
float tr,
float ttheta);
63 CPoint(
char s,
double tr,
double ttheta) { dimn=2; x=tr * cosf(ttheta); y=tr * sinf(ttheta); z=0; }
65 CPoint(PointMode m,
float tr,
float ttheta,
float psi);
66 CPoint(
char s,
double tr,
double ttheta,
double tele){
67 dimn=3; x=tr*cosf(ttheta)*cosf(tele); y=tr*sinf(ttheta)*cosf(tele); z=tr*sinf(tele);}
73 void set(
int a,
int b) { dimn = 2; x = (float) a; y = (float) b; z = 0; }
74 void set(
int a,
int b,
int c) { dimn = 3; x = (float) a; y = (float) b; z = (float) c; }
79 void set(PointMode m,
float a,
float b);
80 void set(PointMode m,
float a,
float b,
float c);
81 void set(
char s,
double tr,
double ttheta) { dimn=2; x=tr * cosf(ttheta); y=tr * sinf(ttheta); z=0; }
82 void set(
char s,
double tr,
double ttheta,
double tele) {
83 dimn=3; x=tr*cosf(ttheta)*cos(tele); y=tr*sinf(ttheta)*cosf(tele); z=tr*sinf(tele);}
144 return sqrtf(x*x + y*y + z*z);
148 return (x*x + y*y + z*z);
159 void dump() { fprintf(stderr,
" CP: %g @ %g @ %g", x, y, z); }
161 fprintf(stderr,
" CP: %g @ %g @ %g",
COORD_TYPE distance2(CPoint *)
COORD_TYPE operator*(CPoint)
COORD_TYPE operator|(CPoint)
CPoint(char s, double tr, double ttheta, double tele)
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
void setElevation(double tele)
CPoint & operator-=(CPoint)
void setAzimuth(double taz)
void set(double a, double b, double c)
void set(char s, double tr, double ttheta, double tele)
CPoint(double a, double b)
CPoint & operator/=(double)
unsigned setdim(unsigned)
void set(float a, float b)
void rotateBy(double angle)
friend CPoint operator/(CPoint, int)
CPoint & operator^=(CPoint)
COORD_TYPE distance(CPoint *)
void set(float a, float b, float c)
CPoint(float a, float b, float c)
COORD_TYPE operator()(unsigned idx) const
CPoint & operator+=(CPoint)
CPoint(char s, double tr, double ttheta)
CPoint(double a, double b, double c)
void set(char s, double tr, double ttheta)
void set(double a, double b)
CPoint & operator*=(double)
void setMagnitude(double tmag)
void set(int a, int b, int c)
CPoint(int a, int b, int c)