From 28821e8f07ec8bc609a5b5af89fc3473204aeece Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Sat, 31 Aug 2024 16:14:20 +0100 Subject: [PATCH] Update rpkt.cc --- rpkt.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/rpkt.cc b/rpkt.cc index c2b981401..2d134b1c0 100644 --- a/rpkt.cc +++ b/rpkt.cc @@ -365,13 +365,7 @@ void electron_scatter_rpkt(Packet &pkt) { old_dir_cmf[1] * cos(tsc); new_dir_cmf[2] = sin(tsc) * cos(phisc) * sqrt(1 - pow(old_dir_cmf[2], 2.)) + old_dir_cmf[2] * cos(tsc); } else { - new_dir_cmf[0] = sin(tsc) * cos(phisc); - new_dir_cmf[1] = sin(tsc) * sin(phisc); - if (old_dir_cmf[2] > 0) { - new_dir_cmf[2] = cos(tsc); - } else { - new_dir_cmf[2] = -cos(tsc); - } + new_dir_cmf = {sin(tsc) * cos(phisc), sin(tsc) * sin(phisc), (old_dir_cmf[2] > 0) ? cos(tsc) : -cos(tsc)}; } // Need to rotate Stokes Parameters in the scattering plane @@ -546,9 +540,7 @@ void rpkt_event_boundbound(Packet &pkt, const MacroAtomState &pktmastate, const pkt.absorptiontype = pktmastate.activatingline; pkt.absorptionfreq = pkt.nu_rf; - pkt.absorptiondir[0] = pkt.dir[0]; - pkt.absorptiondir[1] = pkt.dir[1]; - pkt.absorptiondir[2] = pkt.dir[2]; + pkt.absorptiondir = pkt.dir; pkt.type = TYPE_MA; if constexpr (TRACK_ION_STATS) {