Skip to main content

This module provides physical constants in uniform format.

[C], electron charge.

q_e = 1.60217662e-19

[J * s], Planks constant.

h = 6.62e-34

[m / s], speed of light.

c = 299792458

[kg], electron mass.

m_e = 9.10938356e-31

[m], electron radius

r_o = 2.8179403267e-15

[K], room temperature

t_room = 273 + 23

[J / K], Boltzmann constant

k_b = 1.38064852e-23

[F / m] = [A2 * s4 / (kg * m3)], permittivity of free space

eps_0: float = 8.85418781e-12

[eV / J] energy converter

Joule_to_eV: float = 6.241509e18

Converts pressure from [Torr] to [Pa]

def torr_to_pa(torr): return torr * 7.5006 * 1e-3

Converts temperature from [deg C] to [deg K]

def cels_to_kelv(cels: float) -> float: return cels + 273.15

floating point infinity

inf = float('inf')

linear interpolation

def interpolate(x_prev: float, x_tgt: float, x_next: float, y_prev: float, y_next: float) -> float:
    return y_prev + (y_next - y_prev) * (x_tgt - x_prev) / (x_next - x_prev)

linear interpolation in array

def interpolate_arr(x_arr: list[float], y_arr: list[float], x: float) -> float:
...

radians to degrees converter

def rad_to_deg(deg: float) -> float:
    return deg * 180 / math.pi

degrees to radians converter

def deg_to_rad(deg: float) -> float:
    return deg * math.pi / 180

angle between two vectors. Result from 0 to 2Pi.

def vector_angle(first_x: float, first_y: float, second_x: float, second_y: float) -> float:
    angle = math.atan2(second_y - first_y, second_x - first_x)
    if angle < 0:
        angle += math.tau
    return angle

integrate array by trapz

def integrate(x_arr: list[float], y_arr: list[float]) -> float:
...  

Release files for phys-const 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phys-const 0.1.6
File Size Uploaded
phys_const-0.1.6.tar.gz 3.6 kB Details

Release files / phys_const-0.1.6.tar.gz

Download URL phys_const-0.1.6.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4af55e21587b28df83239218c2287f5bccaf41cfcd4775b46da0e97de086572d
BLAKE2b-256 checksum
How to use checksums
ade8d73f71e0220becebb305bfdcc77e477cac2185de8a8e388f68f573e50963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.6 This release

1 release file

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page