23 #ifndef _LAX_VECTORS_H
24 #define _LAX_VECTORS_H
47 spacevector(
double xx,
double yy,
double zz) {x=xx; y=yy; z=zz; info=0;}
48 spacevector(
double *v) { x=v[0]; y=v[1]; z=v[2]; info=0; }
52 void set(
double xx,
double yy,
double zz) { x=xx; y=yy; z=zz; }
54 bool isZero()
const {
return x==0 && y==0 && z==0; }
55 double norm()
const {
return sqrt(x*x+y*y+z*z); }
87 flatvector(
double xx,
double yy) { x=xx; y=yy; info=0; }
88 flatvector(
double xx,
double yy,
int ninfo) { x=xx; y=yy; info=ninfo; }
89 flatvector(
double *v) { x=v[0]; y=v[1]; info=0; }
93 void set(
double xx,
double yy) { x=xx; y=yy; }
95 bool isZero()
const {
return x==0 && y==0; }
96 double angle()
const {
return atan2(y,x); }
97 double norm()
const {
return sqrt(x*x+y*y); }
129 Basis(spacepoint p1, spacepoint p2, spacepoint p3);
130 Basis(spacepoint pp, spacepoint xx, spacepoint yy, spacepoint zz);
131 Basis(
double *np,
double *nx,
double *ny,
double*nz);
132 void Set(spacepoint p1, spacepoint p2, spacepoint p3);
143 spaceline(spacepoint p1, spacepoint p2) { p=p1; v=p1-p2; }
153 Plane(spacepoint p1,spacepoint p2,spacepoint p3)
186 flatline(flatpoint p1, flatpoint p2) { p=p1; v=p2-p1; }
190 double distance(spacepoint p1,spacepoint p2);
191 double distance(flatpoint p1,flatpoint p2);
192 double distance(flatpoint p, flatpoint p1, flatpoint p2);
199 int segmentcross(flatpoint a1,flatpoint a2,flatpoint b1,flatpoint b2,flatpoint &p);
202 flatpoint
rotate(flatpoint p,
double ang,
int dec=0);
203 flatpoint
rotate(flatpoint p, flatpoint orig,
double ang,
int dec=0);
204 spacepoint
rotate(spacepoint p,
spaceline axis,
double ang,
int dec=0);
205 void rotate(
Basis &b,
char w,
double ang,
int dec=0);
212 spacepoint
invert(spacepoint p, spacepoint orig);