aboutsummaryrefslogtreecommitdiff
path: root/AutopyExtended/Curve/CurveLinear.py
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2020-08-21 22:30:37 +0200
committerLeonard Kugis <leonard@kug.is>2020-08-21 22:30:37 +0200
commit10df6080647e5904a6c03b497586a554b1985a99 (patch)
tree44533fc8de9c28c5ef693a4b5ec263ea1db1d12f /AutopyExtended/Curve/CurveLinear.py
parent1932a860f78830bbff6d9c477409b5e0d5b32b9f (diff)
Curves
Added Linear and Bezier Curves.
Diffstat (limited to 'AutopyExtended/Curve/CurveLinear.py')
-rw-r--r--AutopyExtended/Curve/CurveLinear.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/AutopyExtended/Curve/CurveLinear.py b/AutopyExtended/Curve/CurveLinear.py
new file mode 100644
index 0000000..bee70cc
--- /dev/null
+++ b/AutopyExtended/Curve/CurveLinear.py
@@ -0,0 +1,10 @@
+import numpy as np
+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)))