aboutsummaryrefslogtreecommitdiff
path: root/AutopyExtended/Curve/Linear.py
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2020-08-22 16:02:17 +0200
committerLeonard Kugis <leonard@kug.is>2020-08-22 16:02:17 +0200
commitf43f909bf20dafb2c10520815282046cffe495f2 (patch)
tree5be52b3a048c0b2755a670de4269460353bc9760 /AutopyExtended/Curve/Linear.py
parent3b47fad88c8b714c83c1c90cf6726d85688b300f (diff)
Refactoring, Bezier
Refactored module layout. Added missing dependencies to setup. Added time scaling to curves.
Diffstat (limited to 'AutopyExtended/Curve/Linear.py')
-rw-r--r--AutopyExtended/Curve/Linear.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/AutopyExtended/Curve/Linear.py b/AutopyExtended/Curve/Linear.py
new file mode 100644
index 0000000..f35c095
--- /dev/null
+++ b/AutopyExtended/Curve/Linear.py
@@ -0,0 +1,10 @@
+import numpy as np
+from AutopyExtended.Curve.Curve import Curve
+
+class CurveLinear(Curve):
+ def __init__(self, start, end):
+ self.__start = np.array(start)
+ self.__end = np.array(end)
+ def point(self, t, t_target):
+ d = np.subtract(self.__end, self.__start)
+ return np.add(self.__start, (round(d[0] * t / t_target), round(d[1] * t / t_target)))