Linear interpolation between two points
| 34 | |
| 35 | // Linear interpolation between two points |
| 36 | double InterpolateLinearCurve(Point const & left, Point const & right, double const target) { |
| 37 | double const diff_Y = right.co.Y - left.co.Y; |
| 38 | double const diff_X = right.co.X - left.co.X; |
| 39 | double const slope = diff_Y / diff_X; |
| 40 | return left.co.Y + slope * (target - left.co.X); |
| 41 | } |
| 42 | |
| 43 | // Bezier interpolation between two points |
| 44 | double InterpolateBezierCurve(Point const & left, Point const & right, double const target, double const allowed_error) { |
no outgoing calls
no test coverage detected