32 int nb_pts=ctrpts.size();
36 for (
int i=0;i<nb_pts;i++)
52 cosi=ctrpts[i].
get_x()/nori;
53 sini=ctrpts[i].get_y()/nori;
60 cosi=ctrpts[i].get_y()/nori;
61 sini=ctrpts[i].get_z()/nori;
69 cosi=ctrpts[i].
get_x()/nori;
70 sini=ctrpts[i].get_z()/nori;
75 double2 d_theta=sini*costh-cosi*sinth;
93 return ((
a>b)? b :
a);
122 static const double2 GOLD=1.618034;
123 static const double2 GLIMIT=100.0;
124 static const double2 TINY=1.0e-20;
131 double2 fva=(*func)(ax,ctrpts,plan);
132 double2 fvb=(*func)(bx,ctrpts,plan);
133 double2 fvc=(*func)(cx,ctrpts,plan);
139 fva=(*func)(ax,ctrpts,plan);
140 fvb=(*func)(bx,ctrpts,plan);
150 fvb=(*func)(bx,ctrpts,plan);
151 fvc=(*func)(cx,ctrpts,plan);
155 fa=(*func)(ax,ctrpts,plan);
156 fb=(*func)(bx,ctrpts,plan);
163 fc=(*func)(cx,ctrpts,plan);
170 u=bx-((bx-cx)*q-(bx-ax)*r)/(d*
Sign(
Max((q-r).get_fabs(),TINY),q-r));
171 ulim=bx+GLIMIT*(cx-bx);
172 if ((bx-u)*(u-cx)>zer)
174 fu=(*func)(u,ctrpts,plan);
190 fu=(*func)(u,ctrpts,plan);
192 else if ((cx-u)*(u-ulim)>zer)
194 fu=(*func)(u,ctrpts,plan);
200 Shift(fb,fc,fu,(*func)(u,ctrpts,plan));
203 else if ((u-ulim)*(ulim-cx)>=zer)
206 fu=(*func)(u,ctrpts,plan);
211 fu=(*func)(u,ctrpts,plan);
221 std::vector<OT_VECTEUR_4DD>
system_axes(std::vector<OT_VECTEUR_4DD>& ctrpts)
223 std::vector<OT_VECTEUR_4DD> syst_axe;
224 int nb_points=ctrpts.size();
225 std::vector<OT_VECTEUR_4DD> ctrpts_proj;
235 for (
int i=0;i<nb_points;i++)
237 if (ctrpts[i].get_x()==x0) cmpt1++;
238 if (ctrpts[i].get_y()==y0) cmpt2++;
239 if (ctrpts[i].get_z()==z0) cmpt3++;
242 if (cmpt1==nb_points) plan=23;
243 if (cmpt2==nb_points) plan=13;
244 if (cmpt3==nb_points) plan=12;
248 min_Brak(ax,bx,cx,fa,fb,fc,ctrpts,plan);
249 double theta= bx.
get_x();
259 normal[0] =(axe1.
get_x()).get_x();
260 normal[1] =(axe1.
get_y()).get_x();
261 normal[2] =(axe1.
get_z()).get_x();
262 double root[3]={0.,0.,0.};
267 for (
int i=0;i<nb_points;i++)
271 pnt[0] =(ctrpts[i].get_x()).get_x();
272 pnt[1] =(ctrpts[i].get_y()).get_x();
273 pnt[2] =(ctrpts[i].get_z()).get_x();
281 if ((proj_pnt[0]!=0.||proj_pnt[1]!=0.||proj_pnt[2]!=0)&&!pris)
283 e1_proj[0]=proj_pnt[0];
284 e1_proj[1]=proj_pnt[1];
285 e1_proj[2]=proj_pnt[2];
286 double norm=
sqrt(pow(proj_pnt[0],2)+pow(proj_pnt[1],2)+pow(proj_pnt[2],2));
288 e1_proj[0]=e1_proj[0]/norm;
289 e1_proj[1]=e1_proj[1]/norm;
290 e1_proj[2]=e1_proj[2]/norm;
292 e2_proj[0]=normal[1]*e1_proj[2]-normal[2]*e1_proj[1];
293 e2_proj[1]=normal[2]*e1_proj[0]-normal[2]*e1_proj[2];
294 e2_proj[2]=normal[0]*e1_proj[1]-normal[2]*e1_proj[0];
302 P.change_vecteur1(V1);
303 P.change_vecteur2(
V2);
304 P.change_vecteur3(V3);
319 ctrpts_proj.insert(ctrpts_proj.end(),pt_proj);
322 min_Brak(ax,bx,cx,fa,fb,fc,ctrpts_proj,plan);
328 double nnv_x=Vp*
P.get_vecteur1();
329 double nnv_y=Vp*
P.get_vecteur2();
330 double nnv_z=Vp*
P.get_vecteur3();
338 axe3[0]=axe1[1]*axe2[2]-axe1[2]*axe2[1];
339 axe3[1]=axe1[2]*axe2[0]-axe1[2]*axe2[2];
340 axe3[2]=axe1[0]*axe2[1]-axe1[2]*axe2[0];
345 syst_axe.insert( syst_axe.end(),axe1);
346 syst_axe.insert( syst_axe.end(),axe2);
347 syst_axe.insert( syst_axe.end(),axe3);
358 for (
int i=0;i<strlen(var)+1;i++)
361 if ((var[i]!=
' ') && (var[i]!=0))
364 if ((var[i]==
' ') || (var[i]==0))
424 catch (mu::Parser::exception_type &e)
436 for (
int i=0;i<nb_pas;i++)
438 double ti=
a+(b-
a)/nb_pas*i;
439 double tii=
a+(b-
a)/nb_pas*(i+1.);
440 double xsi=-1./
sqrt(3);
441 double t=(tii-ti)/2.*xsi+(tii+ti)/2.;
443 intg=intg+(tii-ti)/2.*(1.*
res);
445 t=(tii-ti)/2.*xsi+(tii+ti)/2.;
447 intg=intg+(tii-ti)/2.*(1.*
res);
bool V2(MCBody *_mcBody, MG_ELEMENT_TOPOLOGIQUE *topo)
static void Proj3D_Point_Plan(double *norm, double *root, double *pnt, double *proj_pnt)
virtual int get_nb_variable(void)
virtual std::string get_nom_variable(int num)
virtual ~OT_FONCTION_SYMBOLIQUE()
OT_FONCTION_SYMBOLIQUE(char *f, char *var)
std::vector< std::string > variable
virtual double evalue(double *var)
virtual void def_fonction(char *nom, double f(double))
virtual double integre(double a, double b, int nb_pas=32)
virtual void change_y(double2 y)
virtual void change_x(double2 x)
virtual double2 get_y(void) const
virtual void change_z(double2 z)
virtual void change_w(double2 w)
virtual double2 get_z(void) const
virtual double2 get_x(void) const
double f(double x, long nb, double *xfonc, double *fonc, double eng, double eni, double lambda, double nor, double *fonc2)
double2 sin(double2 &val)
double2 sqrt(double2 &val)
double2 cos(double2 &val)
double2 Min(double2 a, double2 b)
double2 Sign(double2 a, double2 b)
void Shift(double2 &a, double2 &b, double2 &c, double2 d)
double2 Max(double2 a, double2 b)
double2 moment(double2 theta, std::vector< OT_VECTEUR_4DD > &ctrpts, int plan)
void min_Brak(double2 &ax, double2 &bx, double2 &cx, double2 &fa, double2 &fb, double2 &fc, std::vector< OT_VECTEUR_4DD > &ctrpts, int plan)
void swap(double2 &a, double2 &b)
std::vector< OT_VECTEUR_4DD > system_axes(std::vector< OT_VECTEUR_4DD > &ctrpts)