Skip to content

Commit

Permalink
created cubic spline instance of x and y
Browse files Browse the repository at this point in the history
  • Loading branch information
ShisatoYano committed Aug 21, 2024
1 parent 0951863 commit 0118779
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/course/cubic_spline_course/cubic_spline_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class CubicSpline2D:

def __init__(self, x_points, y_points):
self.dists = self._calculate_distance_from_start(x_points, y_points)
self.sx = CubicSpline(self.dists, x_points)
self.sy = CubicSpline(self.dists, y_points)

def _calculate_distance_from_start(self, x_points, y_points):
dx = np.diff(x_points)
Expand Down

0 comments on commit 0118779

Please sign in to comment.