Ignore:
Timestamp:
06/19/07 12:17:36 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MMath.cc

    r8581 r8585  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.35 2007-06-18 14:42:32 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.36 2007-06-19 11:14:33 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    308308TVector3 MMath::GetParab(const TVector3 &x, const TVector3 &y)
    309309{
    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);
    317317
    318318    const double det =
     
    343343}
    344344
     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//
    345350Double_t MMath::InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x)
    346351{
    347352    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//
     362Double_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);
    348365    return c(0) + c(1)*x + c(2)*x*x;
    349366}
  • trunk/MagicSoft/Mars/mbase/MMath.h

    r8544 r8585  
    3939    TVector3 GetParab(const TVector3 &x, const TVector3 &y);
    4040    Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x);
     41    Double_t InterpolParabLin(const TVector3 &vy, Double_t x);
    4142    Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x);
    4243    Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
Note: See TracChangeset for help on using the changeset viewer.