Ignore:
Timestamp:
09/02/19 23:11:19 (5 years ago)
Author:
tbretz
Message:
Being more simple
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msimreflector/MFresnelLens.cc

    r19606 r19607  
    189189
    190190    // u: incoming direction (normalized!)
    191     // n: normal vector of surface (pointing into direction of change of refractive index)
     191    // n: normal vector of surface (pointing back into the old medium?)
    192192    // n1: refractive index of old medium
    193193    // n2: refractive index of new medium
     
    264264
    265265    const double so    = rc / sqrt(rc*rc + F*F);
    266     const double theta = -atan(so / (1-sqrt(n0*n0 - so*so)));
    267 
    268     //             theta                peak_z
    269     const Groove g(TMath::Pi()/2 - theta, r0*tan(theta));
     266    const double theta = atan(so / (1-sqrt(n0*n0 - so*so)));
     267
     268    //             theta                   peak_z (defined positive)
     269    const Groove g(TMath::Pi()/2 + theta, -r0*tan(theta));
    270270
    271271    // Calculate the insersection between the ray and the cone
     
    289289    // FIXME: Surface roughness?
    290290    TVector3 norm;;
    291     norm.SetMagThetaPhi(1, g.fTheta-TMath::Pi()/2, p.XYvector().Phi());
     291    norm.SetMagThetaPhi(1, theta, p.XYvector().Phi());
    292292
    293293    // Apply refraction at lens entrance (change directional vector)
Note: See TracChangeset for help on using the changeset viewer.