1.0.10 • Published 3 years ago

wave-func v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Ψ Func

A TypeScript based relation to the fundimental building blocks of our reality.

I found it difficult to learn the different and difference between the fundimental particles. So I've built a strictly typed package of all of them and how they relate to each other. This is mainly because of the similarly named particles and the same suffix used for all the different types.

Install

$ yarn add wave-func

Fundimental Particles

Properties

PropertyPurposeExample value
particle.nameThe name of the particleelectron
particle.groupThe group of the particlefermion
particle.typeThe type (subtype) of the particlelepton
particle.appliedForcesAn array of forces the particle interacts with[ForceType.ELECTROMAGNETISM]
particle.chargeAn object of the particles charge with positive/negative values{value: 0.333333, state: 'negative'}
particle.chargeForHumansThe charge value for humans+2/3 -1/3
particle.scalarA boolean as to whether the particle is scalarfalse
particle.antiMatterA boolean as to whether the particle is considered antimatterfalse
particle.massThe overall mass of the particle in gmev.511
particle.theoreticalA boolean whether the particle is proven or theoreticalfalse
particle.symbolThe particle's symbole
particle.spinThe particles spin"1/2"

Below is a list of all different types of fundimental particles and some brief info.

Fermions

All particles with mass.

Quarks

namechargespinanti matter
UpQuark+2/31/2false
DownQuark-1/31/2false
TopQuark+2/31/2false
BottomQuark-1/31/2false
StrangeQuark-1/31/2false
CharmQuark+2/31/2false
CharmQuark+2/31/2false
AntiUpQuark-2/31/2true
AntiDownQuark+1/31/2true
AntiTopQuark-2/31/2true
AntiBottomQuark+1/31/2true
AntiStrangeQuark+1/31/2true
AntiCharmQuark-2/31/2true
AntiCharmQuark-2/31/2true

Leptons

namechargespinanti matter
Electron-11/2false
Positron+11/2true
ElectronNeutrino01/2false
ElectronAntiNeutrino01/2true
Muon-11/2false
AntiMuon+11/2true
Tau-11/2false
AntiTau+11/2true
TauNeutrino-11/2false
AntiTauNeutrino01/2true
MuonNeutrino01/2false
AntiMuonNeutrino01/2true

Bosons

'Communication' or 'transfer' particles that interact with applied forced or fermions

nameForcesScalarSpinCharge
PhotonElectromagneticfalse10
GluonStrong forcefalse10
ZBosonWeak forcefalse10
PositiveWBosonWeak forcefalse11
NegativeWBosonWeak forcefalse1-1
Higgs Bosontrue00
import { Photon, UpQuark } from 'wave-func';

const photon = new Photo();

const up = new UpQuark();

const bosons = getBosons(up); // [Gluon, PositiveWBoson, NegativeWBoson, ZBoson]

Forces

  • Electromagnetic
  • Weak force
  • Strong force (chromodynamic)

Spin

The spin of a particle

Elements

The atoms of our reality

import { Oxygen } from 'wave-func';

const oxygen = new Oxygen();

console.log(oxygen.symbol, oxygen.hardons, oxygen.electrons, oxygen.electronShells, oxygen.meltingPoint, oxygen.boilingPoint)

Properties

PropertyPurposeExample value
element.electronsThe amount of electrons charged to atom. In shells[2, 8, 8, 2]
element.electronShellsThe number of electron shells on an atm4
element.nameThe name of the element from ElementName enumCalcium
element.numberThe atomic number of the element (number of protons considered neutral)20
element.atomicSymbolThe symbol given to the atomic structureCa
element.symbolThe atomic symbol and the sub of the element's proton count if required21Ca
element.groupThe atomic group of the elementAlkalin metals
element.meltingPointThe melting point of the element in kelvin1115
element.boilingPointThe boiling point of the element in kelvin1757
element.hardonsAn array of hardon particles in the nucleus[[Function Proton], [Function Neutron]] (not a helpful example)
element.chargeThe overall charge of the element (sum of proton charge, neutron charge and electron charge)0 1
element.overallChargeStatusThe overall charge of the element: positive or negativenegative
element.stableA boolean of the overall atom's chargetrue

Functions

addHardon

Adds a hardon particle to the nucleus which will change the overall atom's charge, stability and symbol output.

const element = new Oxygen();

console.log(element.symbol); // O
console.log(element.charge); // 0
console.log(element.stable); // true

element.addHardon(new Proton());

console.log(element.symbol); // 9O
console.log(element.charge); // 1
console.log(element.stable); // false

Eventually I want to be able to change the element's atomic name and prototype based on the overall protons/neutrons in the hardon array (nucleus)

Charge

import { Proton, Neutron, Carbon } from 'wave-func';

const proton = new Proton();
const neutron = new Neutron();

console.log(proton.charge); // 1
console.log(neutron.charge); // 0

const carbon = new Carbon();

console.log(carbon.charge); // 0

carbon.addHardon(new Proton());
console.log(carbon.charge); // 1

Anti matter

import { Proton, Electron, oppositeMatter } from 'wave-func';

const antiMatter = oppositeMatter(new Proton()); // AntiProton
const antiMatter = oppositeMatter(new Electron()); // Positron

Idea

import { Oxygen, Neutron, Proton } from 'wave-func';

const element = new Oxygen();

console.log(element.constructor); // [Function Oxygen]
element.addHardon(new Neutron());

console.log(element.contructor, element.symbol); // [Function Oxygen] 9O

element.addHardon(new Proton());
console.log(element.constructor, element.symbol); // [Function Fluorine] F
1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago