Skip to content

Commit

Permalink
Update CubicHermiteSplineSpec.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 30, 2016
1 parent 7d66477 commit 807e53f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ class CubicHermiteSplineSpec : FreeSpec() {
"Spline should intersect (x2,y2)" {
chs.interpolate(x2) shouldBe exactly(y2)
}
val delta = 0.01
"Spline slope at x1,y1 should be approximately m1" {
val slope = (chs.interpolate(1.51)-chs.interpolate(x1)) / 0.01
val slope = (chs.interpolate(x1 + delta)-chs.interpolate(x1)) / delta
slope shouldBe (m1 plusOrMinus 0.05)
}
"Spline slope at x2,y2 should be approximately m2" {
val slope = (chs.interpolate(3.21)-chs.interpolate(x2)) / 0.01
val slope = (chs.interpolate(x2 + delta)-chs.interpolate(x2)) / delta
slope shouldBe (m2 plusOrMinus 0.05)
}
}
}
}

0 comments on commit 807e53f

Please sign in to comment.