summaryrefslogtreecommitdiff
path: root/my_functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'my_functions.py')
-rw-r--r--my_functions.py29
1 files changed, 7 insertions, 22 deletions
diff --git a/my_functions.py b/my_functions.py
index 1f76b82..49dc87d 100644
--- a/my_functions.py
+++ b/my_functions.py
@@ -94,28 +94,13 @@ def calc_translation_matrix(x_translation, y_translation, z_translation):
##############################################################
# interpolate function
-# used to find a value in an inte
-rval with the specified mode.
+# used to find a value in an interval with the specified mode.
# So that it is clear that the values are points that have 2
# coordinates I will treat the input as they are (x,y) points
# the function will either return m_x or m_y depending on
-# which of the middle point value
-
-s is provided to the function
+# which of the middle point values is provided to the function
# (set None to the variable going to be returned by the
-# function). Smooth will use the Cubic Hermite Spline
-# interpolation method and will be the one using the point's
-# derivatives/tangent.
-#
-# IMPORTANT (FOR SMOOTH INTERPOLA
-TION):
-#
-# As I don't really have information on how to define
-# tangent-out or tangent in/out interpolation (as JAE has
-# already done those calculations) I will use the same
-# interpolation method to both tangent-out or tangent in/out
-# CSV files. If someone knows about this better please open
-# an issue on blenxy's repository
+# function). Only linear interpolation is supported for now.
#
# l_x (float) --> left point X axis component
# l_y (float) --> left point Y axis component
@@ -124,7 +109,6 @@ TION):
# m_x (float) --> middle point X axis component
# m_y (float) --> middle point Y axis component
# interp_type (string) --> "linear" for linear interpolation
-# "smooth" for smooth interpolation
##############################################################
def interpolate(l_x, l_y, r_x, r_y, m_x, m_y, interp_type):
#
@@ -141,16 +125,17 @@ def interpolate(l_x, l_y, r_x, r_y, m_x, m_y, interp_type):
###############################
# m_x is the one to be returned
if (m_x == None):
+
+ # linear interpolation
if (interp_type == "linear"):
m_x = (((r_x - l_x) / (r_y - l_y)) * (m_y - r_y)) + r_x
result = m_x
- else: # interpolation type is "smooth"
-
-
###############################
# m_y is the one to be returned
if (m_y == None):
+
+ # linear interpolation
if (interp_type == "linear"):
m_y = (((r_y - l_y) / (r_x - l_x)) * (m_x - r_x)) + r_y
result = m_y