Changeset 8585 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 06/19/07 12:17:36 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MMath.cc
r8581 r8585 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.3 5 2007-06-18 14:42:32tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.36 2007-06-19 11:14:33 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 308 308 TVector3 MMath::GetParab(const TVector3 &x, const TVector3 &y) 309 309 { 310 Double_t x1 = x(0);311 Double_t x2 = x(1);312 Double_t x3 = x(2);313 314 Double_t y1 = y(0);315 Double_t y2 = y(1);316 Double_t y3 = y(2);310 const Double_t x1 = x(0); 311 const Double_t x2 = x(1); 312 const Double_t x3 = x(2); 313 314 const Double_t y1 = y(0); 315 const Double_t y2 = y(1); 316 const Double_t y3 = y(2); 317 317 318 318 const double det = … … 343 343 } 344 344 345 // -------------------------------------------------------------------------- 346 // 347 // Interpolate the points with x-coordinates vx and y-coordinates vy 348 // by a parabola (second order polynomial) and return the value at x. 349 // 345 350 Double_t MMath::InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x) 346 351 { 347 352 const TVector3 c = GetParab(vx, vy); 353 return c(0) + c(1)*x + c(2)*x*x; 354 } 355 356 // -------------------------------------------------------------------------- 357 // 358 // Interpolate the points with x-coordinates vx=(-1,0,1) and 359 // y-coordinates vy by a parabola (second order polynomial) and return 360 // the value at x. 361 // 362 Double_t MMath::InterpolParabLin(const TVector3 &vy, Double_t x) 363 { 364 const TVector3 c(vy(1), (vy(2)-vy(0))/2, vy(0)/2 - vy(1) + vy(2)/2); 348 365 return c(0) + c(1)*x + c(2)*x*x; 349 366 } -
trunk/MagicSoft/Mars/mbase/MMath.h
r8544 r8585 39 39 TVector3 GetParab(const TVector3 &x, const TVector3 &y); 40 40 Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x); 41 Double_t InterpolParabLin(const TVector3 &vy, Double_t x); 41 42 Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x); 42 43 Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
Note:
See TracChangeset
for help on using the changeset viewer.