1 | <?php |
||
14 | class BilinearInterpolation implements InterpolationInterface |
||
15 | { |
||
16 | use ArgumentsCheckTrait; |
||
17 | |||
18 | /** |
||
19 | * Interpolate. |
||
20 | * |
||
21 | * p0------------p1 |
||
22 | * | | |
||
23 | * | y |
||
24 | * | | |
||
25 | * |--x-- Z |
||
26 | * | |
||
27 | * p2------------p3 |
||
28 | * |
||
29 | * @param float $x x position of Z within bounding box, required: $x in [0.0, 1.0] |
||
30 | * @param float $y y position of Z within bounding box, required: $y in [0.0, 1.0] |
||
31 | * @param array $elevationOnBoundingBox elevation data on [p0, p1, p2, p3] |
||
32 | * @return int estimated elevation on point Z |
||
33 | * @throws InvalidArgumentException |
||
34 | */ |
||
35 | public function interpolate($x, $y, array $elevationOnBoundingBox) |
||
46 | } |
||
47 |