- Removed -fwritable-string

SKIPPED:
	psi/dornier2.c
	psi/ecbdriv.c
	psi/el734hp.c
	psi/libpsi.a
	psi/make_gen
	psi/makefile_linux
	psi/pimotor.c
	psi/pipiezo.c
	psi/sinqhttp.c
	psi/tcpdornier.c
	psi/velodornier.c
This commit is contained in:
koennecke
2006-03-31 15:24:52 +00:00
parent 4081448055
commit 51a60375d6
38 changed files with 1232 additions and 154 deletions

View File

@ -20,6 +20,7 @@
#define DEGREE_RAD (PI/180.0) /* Radians per degree */
#define VERT 0
#define HOR 1
#define INPLANEPREC 0.01
/*============== monochromator/analyzer stuff =========================*/
double energyToK(double energy){
double K;
@ -178,6 +179,9 @@ MATRIX calcPlaneNormal(tasReflection r1, tasReflection r2){
planeNormal[i][0] = -1.*planeNormal[i][0];
}
}
mat_free(u1);
mat_free(u2);
normalizeVector(planeNormal);
return planeNormal;
} else {
return NULL;
@ -438,7 +442,7 @@ int calcTasQAngles(MATRIX UB, MATRIX planeNormal, int ss, tasQEPosition qe,
angles->a3 = om + theta;
/*
put a3 into -180, 180 properly. We cal always turn by 180 because the
put a3 into -180, 180 properly. We can always turn by 180 because the
scattering geometry is symmetric in this respect. It is like looking at
the scattering plane from the other side
*/
@ -674,3 +678,44 @@ double getTasPar(tasQEPosition qe, int tasVar){
assert(0);
}
}
/*-------------------------------------------------------------------------*/
int isInPlane(MATRIX planeNormal, tasQEPosition qe){
MATRIX v = NULL;
double val;
v = makeVector();
v[0][0] = qe.qh;
v[1][0] = qe.qk;
v[2][0] = qe.ql;
val = vectorDotProduct(planeNormal,v);
mat_free(v);
if(ABS(val) > INPLANEPREC){
return 0;
} else {
return 1;
}
}
/*--------------------------------------------------------------------*/
MATRIX calcScatteringPlaneNormal(tasQEPosition qe1, tasQEPosition qe2){
MATRIX v1 = NULL, v2 = NULL, planeNormal;
v1 = makeVector();
v2 = makeVector();
if(v1 != NULL && v2 != NULL){
v1[0][0] = qe1.qh;
v1[1][0] = qe1.qk;
v1[2][0] = qe1.ql;
v2[0][0] = qe2.qh;
v2[1][0] = qe2.qk;
v2[2][0] = qe2.ql;
planeNormal = vectorCrossProduct(v1,v2);
normalizeVector(planeNormal);
mat_free(v1);
mat_free(v2);
return planeNormal;
} else {
return NULL;
}
}