Skip to content

Commit a512f93

Browse files
authored
Fixed hyperbolic functions
1 parent 1936885 commit a512f93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/framework/tools/src/TRestPhysics.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ TVector3 GetParabolicVectorIntersection(const TVector3& pos, const TVector3& dir
124124
TVector3 GetHyperbolicVectorIntersection(const TVector3& pos, const TVector3& dir, const Double_t beta,
125125
const Double_t R3, const Double_t focal) {
126126
Double_t e = 2 * R3 * TMath::Tan(beta);
127+
Double_t alpha = beta / 3;
127128
/// Just replaced here *TMath::Cot by /TMath::Tan to fix compilation issues
128129
Double_t g = 2 * R3 * TMath::Tan(beta) / (focal + R3 / TMath::Tan(2 * alpha));
129130
Double_t a = dir.X() * dir.X() + dir.Y() * dir.Y() - g * dir.Z() * dir.Z();
@@ -222,6 +223,7 @@ TVector3 GetParabolicNormal(const TVector3& pos, const Double_t alpha, const Dou
222223
TVector3 GetHyperbolicNormal(const TVector3& pos, const Double_t beta, const Double_t R3,
223224
const Double_t focal) {
224225
TVector3 normalVec = pos;
226+
Double_t alpha = beta / 3;
225227
/// Just replaced here *TMath::Cot by /TMath::Tan to fix compilation issues
226228
Double_t m = 1 / (R3 * TMath::Tan(beta) * (1 - 2 * pos.Z() / (focal + R3 / TMath::Tan(2 * alpha))) /
227229
TMath::Sqrt(R3 * R3 - R3 * 2 * TMath::Tan(beta) * pos.Z() *

0 commit comments

Comments
 (0)