added utils from different project

This commit is contained in:
2024-12-15 22:50:41 +01:00
parent 6db9bd85a5
commit eb0eb436ed
15 changed files with 2636 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
if __name__ == "__main__": # If the Helper.py file is run directly
print("This is a modul and should be imported")
import math
class Stepper:
# step as degrees
Step : float
# step as radiant
StepRad : float
# steps for full resolution
Steps : int
# microsteps per step
Resolution : int
def __init__(self, step, res):
self.Step = step
self.Steps = 360 / step
self.StepRad = math.pi * step/180
self.Resolution = res
class QuadWave:
Sine : []
Cosine : []
def __init__(self, resolution):
sine = []
cosine = []
s = 2 * math.pi / resolution
for i in range(resolution):
sine.append(math.sin(s * i))
cosine.append(math.cos(s * i))
self.Sine = sine
self.Cosine = cosine