Fixed addauxref for the triple axis code

Added a writing state to status
This commit is contained in:
boa
2014-08-15 13:36:36 +02:00
parent 1d1f102b08
commit 9e898d1476
10 changed files with 142 additions and 30 deletions

View File

@ -189,6 +189,37 @@ double angleBetween(MATRIX v1, MATRIX v2)
}
return angle;
}
/*-----------------------------------------------------------------------
angleBetween gives only angles between 0 - 180. This is also the
only thing there is; the direction of the rotation depends on the
viewpoint and thus is ill defined. This version determines the
sign of the rotation from v3[2]. I made a special version in order not
to trouble other uses of angleBetween.
-----------------------------------------------------------------------*/
double tasAngleBetween(MATRIX v1, MATRIX v2)
{
double angle, angles, sum;
MATRIX v3 = NULL;
int i;
angle = vectorDotProduct(v1, v2) / (vectorLength(v1) * vectorLength(v2));
v3 = vectorCrossProduct(v1, v2);
if (v3 != NULL) {
angles = vectorLength(v3) / (vectorLength(v1) * vectorLength(v2));
angle = Atan2d(angles, angle);
for(i = 0, sum = .0; i < 3; i++){
sum += v3[i][0];
}
if(sum < 0){
angle *= -1.;
}
} else {
angle = Acosd(angle);
}
return angle;
}
/*----------------------------------------------------------------------*/
void scaleVector(MATRIX v, double scale)