using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static ManyWorldsTheory.Atome; using UnitsNet.Units; using UnitsNet; namespace ManyWorldsTheory { public class Particles { double speed; public double radius; public double mass; public double ElectConductivity ; public double charge; double MainQuantumNumber; //= German: hauptQuantenZahl = Schale im Atom = The Level of Energy in an Atom (see Atomic model of Nils Bohr) int Electrons; public int Protons; public int Neutrons; bool hasvalenzelectrons; bool isinspace; Vector3D.Vector Impulsvect; Vector3D.Vector placevektor; public string shortname, name; public int AtomicNumber = 0; // = The Number ("Order) in the Periodic Table of the Elements public double enegativity = 0.00; double density; public TAlex.MathCore.LinearAlgebra.Vector3D Colour; public double ℎ = 6.62607015 * Math.Pow(10.000, -34.000); public double ℏ() //ugs.: "reduziertes h" { var x = (ℎ / (2 * Math.PI)); return x; } Particles() { setProtons(0); setspeed(0); setradius(0); setmass(0); setElectricalConductivity(0); setMainQuantumNumber(0); setElektrons(0); setvector3D(0, 0, 0); if ((placevektor.X == 0) && placevektor.Y == 0 && placevektor.Z == 0) { this.isinspace = false; setImplusvector3D(0, 0, 0); } this.hasvalenzelectrons = false; } public void setProtons(int dbl) { this.Protons = dbl; } public int getProtons() { return this.Protons; } public void setNeutrons(int dbl) { this.Neutrons = dbl; } public int geNeutrons() { return this.Neutrons; } public Particles getIsotopeofParticles(int Protonzahl, int Neutronszahl, Particles t) { if (t.Protons == Protonzahl && t.Neutrons != Neutronszahl) { return t; } return t; } public double getSchroedingerPlace(double Impuls, Particles t, TAlex.MathCore.UnitConversion.Quantities.Time Time) { return ((-TAlex.MathCore.Complex.Pow(ℏ(), 2) / 2 * t.getmass()).Argument); } Particles(double speed, double r, double mass, double ladung, double MQN, int electron, Vector3D.Vector vort, bool hasevalenz, Vector3D.Vector Impuls, int Protonenzahl, int neutronenzahl, bool isinspace = true) { setspeed(speed); setradius(r); setmass(mass); setcharge(ladung); setMainQuantumNumber(MQN); setElektrons(electron); setvector3D(vort.X, vort.Y, vort.Z); if (isinspace == true) setvector3D(vort.X, vort.Y, vort.Z); if ((placevektor.X != 0) && placevektor.Y != 0 && placevektor.Z != 0) { setImplusvector3D(Impuls.X, Impuls.Y, Impuls.Z); } else { isinspace = false; setImplusvector3D(0.00, 0.00, 0.00); } this.hasvalenzelectrons = hasevalenz; this.setDensity(this.calculateDensity()); } public Particles(int AtomicNumber, string shortname, string name, double mass, double radius, double ElectConductivity, double eNegativitaet, int prot, int neutron, bool isinspace = true) { this.setAtomicNumber(AtomicNumber); this.setShortname(shortname); this.setName(name); this.setmass(mass); this.setradius(radius); this.setElectricalConductivity(ElectConductivity); this.setEnegat(eNegativitaet); this.isinspace = true; this.setDensity(this.calculateDensity()); this.setProtons(prot); this.setNeutrons(neutron); } public void setName(string name) { this.name = name; } public string getName() { return this.name; } public void setShortname(string shortname) { this.shortname = shortname; } public string getShortname() { return this.shortname; } public void setAtomicNumber(int z) { this.AtomicNumber = z; } public int getAtomicNumber() { return this.AtomicNumber; } public void setcharge(double z) { this.charge = z; } public double getcharge() { return this.charge ; } public void setDensity(double calculatedfunctionvalue) { this.density = calculatedfunctionvalue; } public void setspeed(double sp) { //this.speed = sp; this.speed = UnitsNet.Speed.FromMetersPerSecond(sp).MetersPerSecond; } public double getspeed() { return this.speed; } public void petisinspace(bool b) { this.isinspace = b; } public bool getisinspace() { return this.isinspace; } public void setvector3D(double x, double y, double z) { this.placevektor.X = x; this.placevektor.Y = y; this.placevektor.Z = z; } public void setImplusvector3D(double x, double y, double z) { this.Impulsvect.X = x; this.Impulsvect.Y = y; this.Impulsvect.Z = z; } public Vector3D.Vector getortsvector() { return this.placevektor; } public Vector3D.Vector getImpuls() { return this.Impulsvect; } public void setradius(double r) { //this.radius = r; this.radius = Length.FromMeters(r).Meters; } public double getradius() { return this.radius; } public void setmass(double mass) { //this.mass = mass; this.mass = Mass.FromKilograms(mass * Math.Pow(10, -27)).Kilograms; } public double getmass() { return this.mass; } public void setElectricalConductivity (double ld) { //this.ElectConductivity = ld; this.ElectConductivity = ElectricConductivity.FromSiemensPerMeter(ld).SiemensPerMeter; } public double getElectConductivity () { return this.ElectConductivity ; } public void setMainQuantumNumber(double MQN) { this.MainQuantumNumber = MQN; } public double getMainQuantumNumber() { return this.MainQuantumNumber; } public void setElektrons(int e) { this.Electrons = e; } public int getElectrons() { return this.Electrons; } public void setEnegat(double number) { this.enegativity = number; } public double getEngat() { return this.enegativity; } public double calculateDensity() { double VolumeofCoreofAtom = (((4 * Math.PI) / 3)* Math.Pow(getradius(),3)); //return getmass() / VolumeofCoreofAtom; return Density.FromKilogramsPerLiter(getmass() / VolumeofCoreofAtom).KilogramsPerCubicMeter; } public async void setcolour(string colour, Particles t) { ColourapproximationQuantumTheory coloursQuantumTheory = new ColourapproximationQuantumTheory(); bool isallrightvariable = false; coloursQuantumTheory.isallright().Start(); isallrightvariable = await coloursQuantumTheory.isallright(); if (isallrightvariable == true) coloursQuantumTheory.setcolour(colour); else { isallrightvariable = coloursQuantumTheory.isallright().Result; } } public static Particles operator +(Particles a, Particles b) { return new Particles(0, a.getShortname() + b.getShortname(), a.getName() + b.getName(), a.getmass() + b.getmass(), a.getradius() + b.getradius(), a.getElectConductivity () + b.getElectConductivity (), a.getEngat() + b.getEngat(), a.getProtons() + b.getProtons(), a.geNeutrons() + b.geNeutrons()) { AtomicNumber = 0, shortname = a.getShortname() + b.getShortname(), name = a.getName() + b.getName(), mass = a.getmass() + b.getmass(), radius = a.getradius() + b.getradius(), ElectConductivity = a.getElectConductivity () + b.getElectConductivity (), enegativity = a.getEngat() + b.getEngat(), Protons = a.getProtons() + b.getProtons(), Neutrons = a.geNeutrons() + b.geNeutrons() }; } } }