19 TVector3 x2, TVector3 v2, Double_t m2_, Bool_t fixed2_,
21 Compute(x1, v1, m1_, fixed1_, x2, v2, m2_, fixed2_, kappa_);
32 r =
v =
vcm = TVector3();
44 if(p1==
nullptr || p2==
nullptr || p1==p2){
54 TVector3 x2, TVector3 v2, Double_t m2_, Bool_t fixed2_,
67 if(
fixed1) v1 = TVector3();
68 if(
fixed2) v2 = TVector3();
83 return Compute(r_, v_, mu_, kFALSE, TVector3(), TVector3(), 0., kTRUE, kappa_);
88 const Double_t rmag =
r.Mag();
89 if(!(rmag>0.) || !(
mu>0.))
return;
91 const Double_t v2 =
v.Mag2();
92 const Double_t vmag = TMath::Sqrt(v2);
93 const TVector3 rhat =
r*(1./rmag);
94 const TVector3 h =
r.Cross(
v);
95 const Double_t hmag = h.Mag();
96 const Double_t ke = 0.5*
mu*v2;
97 const Double_t pe =
kappa/rmag;
113 TVector3 perp =
r -
v*(
r.Dot(
v)/v2);
114 phat = (perp.Mag()>0.) ? perp.Unit() : TVector3();
121 const Double_t agm = TMath::Abs(gm);
123 Double_t e2m1 = 2.*eps*hmag*hmag/(gm*gm);
124 if(e2m1 < -1.) e2m1 = -1.;
125 ecc = TMath::Sqrt(1. + e2m1);
129 const Bool_t radial = (hmag <=
kHeadOnTol*rmag*vmag);
134 rmin = radial ? 0. : hmag*hmag/(2.*agm);
139 rmin = radial ? 0. : (hmag*hmag/agm)/(1.+
ecc);
144 vinf = TMath::Sqrt(2.*eps);
169 const TVector3 nhat = h*(1./hmag);
170 const TVector3 qhat = nhat.Cross(
phat);
171 const Double_t sigma = (
kappa > 0.) ? 1. : -1.;
172 const Double_t s = TMath::Sqrt(e2m1);
175 thetaCM = 2.*TMath::ATan2(1., s);
178 else rmin = (hmag*hmag/agm)/(1.+
ecc);
181static Double_t
LabAngleOf(
const TVector3 & vin,
const TVector3 & vout,
const TVector3 & vinOther){
191 if(
fixed2) { c1 = 1.; c2 = 0.; }
192 else if(
fixed1) { c1 = 0.; c2 = 1.; }
208 case kUnbound:
return TString(
"UNBOUND");
209 case kHeadOn:
return TString(
"HEADON");
210 case kFree:
return TString(
"FREE");
213 case kBound:
return TString(
"BOUND");
214 case kInvalid:
return TString(
"INVALID");
222 out += Form(
" kappa %.6e mu %.6e E %.9e |L| %.9e e %.12f\n",
kappa,
mu,
energy,
lvec.Mag(),
ecc);
223 out += Form(
" rmin %.9f b %.9f vinf %.12e thetaCM %.12f deg\n",
226 out += Form(
" v1out (%.12e, %.12e, %.12e) theta1 %.9f deg\n",
v1out.X(),
v1out.Y(),
v1out.Z(),
thetaLab1*TMath::RadToDeg());
227 out += Form(
" v2out (%.12e, %.12e, %.12e) theta2 %.9f deg\n",
v2out.X(),
v2out.Y(),
v2out.Z(),
thetaLab2*TMath::RadToDeg());
228 if(!mute) std::cout<<out;
239 return TMath::Abs(
kappa)/(
mu*
vinf*
vinf*TMath::Tan(0.5*TMath::Abs(theta)));
244 const Double_t sq = TMath::Sqrt(a*a + b*b);
245 if(a >= 0.)
return a + sq;
258 return 0.5*(TMath::Pi() -
thetaCM);
262 return TMath::ATan2(a.Cross(b).Mag(), a.Dot(b));
static Double_t LabAngleOf(const TVector3 &vin, const TVector3 &vout, const TVector3 &vinOther)
static const Double_t kParabolaTol
static const Double_t kHeadOnTol
static const Double_t kAtRestTol
Analytic two-body 1/r asymptote calculator (asymptote), used to validate the integrators.
TVector3 v2out
lab asymptotic velocities
TVector3 phat
angular momentum, Laplace-Runge-Lenz, eccentricity vector, periapsis direction
Double_t thetaLab2
lab angle of particle 2
static Double_t RecoilAngle(Double_t thetaCM)
Lab angle of the recoiling target at rest, .
Double_t energy
orbital energy
Bool_t fixed2
particle 2 is a fixed centre
Double_t rmin
closest approach
Double_t vinf
relative speed at infinity
TString GetStatusName() const
Name of the status as text: "UNBOUND", "HEADON", "FREE", "RADIAL_ATTRACTIVE", "PARABOLIC",...
Double_t kappa
interaction constant
static Double_t RutherfordClosestApproach(Double_t b, Double_t vinf, Double_t mu, Double_t kappa)
Closest approach for impact parameter b.
Double_t bimp
effective impact parameter
Bool_t Compute(particle *p1, particle *p2, Double_t kappa)
Recompute from two particles (arguments as the matching constructor); all previous results are discar...
Bool_t fixed1
particle 1 is a fixed centre
@ kHeadOn
, , : straight back-scattering, , ,
@ kBound
: ellipse, no asymptote (E, L, A, e, are set)
@ kInvalid
zero distance, non-positive mass (of a moving particle), both particles fixed, or null/identical part...
@ kRadialAttractive
, (whatever the sign of E): falls into the singularity, no asymptote ( )
@ kUnbound
, : hyperbola, every asymptotic quantity is set
@ kFree
: straight line, , (with the relative velocity zero too it is reported as kParabolic with )
@ kParabolic
(within round-off): , no direction
TVector3 vcm
relative position, relative velocity, centre-of-mass velocity
Double_t m1
mass of particle 1 (amu)
Double_t mu
reduced (or moving) mass (amu)
TVector3 voutRel
incoming / outgoing relative velocity
Double_t m2
mass of particle 2 (amu)
Double_t thetaCM
CM scattering angle.
Bool_t HasAsymptote() const
true for kUnbound, kHeadOn, kFree
static Double_t HeadOnClosestApproach(Double_t vinf, Double_t mu, Double_t kappa)
Head-on ( ) closest approach, repulsive.
asymptote()
Empty object; the status is kInvalid until Compute() is called.
static Double_t Angle(const TVector3 &a, const TVector3 &b)
Angle between two vectors, , accurate at 0 and .
Bool_t fixedCentre
exactly one body fixed
status st
orbit classification
static Double_t RutherfordImpactParameter(Double_t theta, Double_t vinf, Double_t mu, Double_t kappa)
Inverse of RutherfordAngle().
Double_t thetaLab1
lab angle of particle 1
static Double_t RutherfordAngle(Double_t b, Double_t vinf, Double_t mu, Double_t kappa)
Rutherford scattering angle in the CM frame.
void Reset()
set every result and input to its empty value (status kInvalid)
TString Print(Bool_t mute=kFALSE) const
Text summary (status, kappa, mu, E, |L|, e, rmin, b, vinf, theta, outgoing velocities).
void Solve()
from r, v, mu, kappa (set by Compute)
static Double_t LabAngle(Double_t thetaCM, Double_t m1, Double_t m2)
Lab angle of the projectile (mass m1) on a target (mass m2) at rest, from the CM angle.
void SetLab()
lab velocities and angles from the relative asymptotes
A point body with mass, position, velocity, step count, time and an optional recorded path.
TVector3 GetV()
Velocity in c (a copy).
Bool_t IsInvincible()
Whether the particle is fixed (invincible).
Double_t GetM0()
Rest mass in amu.
TVector3 GetX()
Position in fm (a copy).