Renamed to Spoolman

Spoolson just didn't sound that good after all
This commit is contained in:
Donkie
2023-04-02 19:19:15 +02:00
parent c31c3dea42
commit 6fd9662c42
19 changed files with 24 additions and 24 deletions

19
spoolman/math.py Normal file
View File

@@ -0,0 +1,19 @@
"""Various math-related functions."""
import math
def weight_from_length(*, length: float, radius: float, density: float) -> float:
"""Calculate the weight of a piece of filament.
Args:
length (float): Filament length in mm
radius (float): Filament radius in mm
density (float): Density of filament material in g/cm3
Returns:
float: Weight in g
"""
volume_mm3 = length * math.pi * radius * radius
volume_cm3 = volume_mm3 / 1000
return density * volume_cm3