(arr, x, y)
| 30079 | } |
| 30080 | |
| 30081 | function interp2d(arr, x, y) { |
| 30082 | var ix = Math.floor(x) |
| 30083 | , fx = x - ix |
| 30084 | , s0 = 0 <= ix && ix < arr.shape[0] |
| 30085 | , s1 = 0 <= ix+1 && ix+1 < arr.shape[0] |
| 30086 | , iy = Math.floor(y) |
| 30087 | , fy = y - iy |
| 30088 | , t0 = 0 <= iy && iy < arr.shape[1] |
| 30089 | , t1 = 0 <= iy+1 && iy+1 < arr.shape[1] |
| 30090 | , w00 = s0&&t0 ? arr.get(ix ,iy ) : 0.0 |
| 30091 | , w01 = s0&&t1 ? arr.get(ix ,iy+1) : 0.0 |
| 30092 | , w10 = s1&&t0 ? arr.get(ix+1,iy ) : 0.0 |
| 30093 | , w11 = s1&&t1 ? arr.get(ix+1,iy+1) : 0.0 |
| 30094 | return (1.0-fy) * ((1.0-fx)*w00 + fx*w10) + fy * ((1.0-fx)*w01 + fx*w11) |
| 30095 | } |
| 30096 | |
| 30097 | function interp3d(arr, x, y, z) { |
| 30098 | var ix = Math.floor(x) |
no outgoing calls
no test coverage detected
searching dependent graphs…