Skip to content
Snippets Groups Projects
Commit e6865e83 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

acos->myacos
parent 424c584d
Branches
Tags
No related merge requests found
// $Id: Entity.cpp,v 1.32 2004-03-01 23:43:53 geuzaine Exp $ // $Id: Entity.cpp,v 1.33 2004-04-13 18:47:32 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -88,8 +88,7 @@ void Draw_Cylinder(double width, double *x, double *y, double *z, int light) ...@@ -88,8 +88,7 @@ void Draw_Cylinder(double width, double *x, double *y, double *z, int light)
prodve(zdir, vdir, axis); prodve(zdir, vdir, axis);
norme(axis); norme(axis);
prosca(zdir, vdir, &cosphi); prosca(zdir, vdir, &cosphi);
phi = 180. * acos(cosphi) / M_PI; phi = 180. * myacos(cosphi) / M_PI;
glTranslatef(x[0], y[0], z[0]); glTranslatef(x[0], y[0], z[0]);
glRotatef(phi, axis[0], axis[1], axis[2]); glRotatef(phi, axis[0], axis[1], axis[2]);
gluCylinder(qua, radius, radius, length, CTX.quadric_subdivisions, 1); gluCylinder(qua, radius, radius, length, CTX.quadric_subdivisions, 1);
...@@ -352,7 +351,7 @@ void Draw_3DArrow(double relHeadRadius, double relStemLength, double relStemRadi ...@@ -352,7 +351,7 @@ void Draw_3DArrow(double relHeadRadius, double relStemLength, double relStemRadi
prodve(zdir, vdir, axis); prodve(zdir, vdir, axis);
norme(axis); norme(axis);
prosca(zdir, vdir, &cosphi); prosca(zdir, vdir, &cosphi);
phi = 180. * acos(cosphi) / M_PI; phi = 180. * myacos(cosphi) / M_PI;
glTranslatef(x, y, z); glTranslatef(x, y, z);
glRotatef(phi, axis[0], axis[1], axis[2]); glRotatef(phi, axis[0], axis[1], axis[2]);
......
// $Id: Utils.cpp,v 1.23 2004-03-28 01:16:50 geuzaine Exp $ // $Id: Utils.cpp,v 1.24 2004-04-13 18:49:58 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -615,7 +615,7 @@ double angle_3pts(Vertex * a, Vertex * b, Vertex * c) ...@@ -615,7 +615,7 @@ double angle_3pts(Vertex * a, Vertex * b, Vertex * c)
prosca = ((a->Pos.X - b->Pos.X) * (c->Pos.X - b->Pos.X) + prosca = ((a->Pos.X - b->Pos.X) * (c->Pos.X - b->Pos.X) +
(a->Pos.Y - b->Pos.Y) * (c->Pos.Y - b->Pos.Y)) / L; (a->Pos.Y - b->Pos.Y) * (c->Pos.Y - b->Pos.Y)) / L;
angle = acos(prosca) * 180. / Pi; angle = myacos(prosca) * 180. / Pi;
return (angle); return (angle);
} }
......
// $Id: Numeric.cpp,v 1.11 2004-02-07 01:40:22 geuzaine Exp $ // $Id: Numeric.cpp,v 1.12 2004-04-13 18:47:32 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -84,6 +84,16 @@ double myasin(double a) ...@@ -84,6 +84,16 @@ double myasin(double a)
return asin(a); return asin(a);
} }
double myacos(double a)
{
if(a <= -1.)
return Pi;
else if(a >= 1.)
return 0.;
else
return acos(a);
}
void prodve(double a[3], double b[3], double c[3]) void prodve(double a[3], double b[3], double c[3])
{ {
c[2] = a[0] * b[1] - a[1] * b[0]; c[2] = a[0] * b[1] - a[1] * b[0];
......
...@@ -58,6 +58,7 @@ int check_gsl(); ...@@ -58,6 +58,7 @@ int check_gsl();
double myatan2(double a, double b); double myatan2(double a, double b);
double myasin(double a); double myasin(double a);
double myacos(double a);
void prodve(double a[3], double b[3], double c[3]); void prodve(double a[3], double b[3], double c[3]);
void prosca(double a[3], double b[3], double *c); void prosca(double a[3], double b[3], double *c);
void norme(double a[3]); void norme(double a[3]);
...@@ -73,7 +74,6 @@ double InterpolateIso(double *X, double *Y, double *Z, ...@@ -73,7 +74,6 @@ double InterpolateIso(double *X, double *Y, double *Z,
double *XI, double *YI ,double *ZI); double *XI, double *YI ,double *ZI);
void gradSimplex(double *x, double *y, double *z, double *v, double *grad); void gradSimplex(double *x, double *y, double *z, double *v, double *grad);
/* Numerical routines implemented using either Numerical Recipes or /* Numerical routines implemented using either Numerical Recipes or
the GSL */ the GSL */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment