def test_parabolic(self): """Approximate y=x**2""" x = 0. x0 = -1. x1 = 1. y0 = 1. dy0 = -2. y1 = 1. dy1 = 2. y = hermite_spline(x, x0, x1, y0, dy0, y1, dy1) self.assertEqual(y, 0.0)
def test_linear(self): """"Approximate y = x - 1""" x = 1. x0 = 0. x1 = 2. y0 = -1. dy0 = 1. y1 = 1. dy1 = 1. y = hermite_spline(x, x0, x1, y0, dy0, y1, dy1) self.assertEqual(y, 0.0)