Bilinear interpolation: Difference between revisions

→‎{{header|J}}: Correct error, matrix multiplication is does not commute. A new assertion helps to verify the result
(→‎{{header|J}}: Correct error, matrix multiplication is does not commute. A new assertion helps to verify the result)
Line 163:
shape_function =: 1 , ] , */
COEFFICIENTS =: (=i.4) %. shape_function"1 CORNERS
shape_functions =: COEFFICIENTS mp~ shape_function
interpolate =: mp shape_functions
</lang>
Line 178:
SADDLE =: 1 2 2.2 0.7 interpolate"_ 1 GRID
viewmat SADDLE
assert 0.7 2.2 -: (<./ , >./) , SADDLE
</pre>
 
Line 227 ⟶ 228:
C123 =: x:inv@:(x:@:identity@:# %. n123"1)3{.N1
NB. interpolants
i122 =: mp (C122 mp~ n122)
i123 =: mp (C123 mp~ n123)
 
 
Line 246 ⟶ 247:
 
NB. interpolants
i244 =: mp (C244 mp~ n244)
i248 =: mp (C248 mp~ n248)
i249 =: mp (C249 mp~ n249)
 
NB. 3D
Line 275 ⟶ 276:
C38q =: x:inv@:(x:@:identity@:# %. x:@:n38q"1)36bq{.N3
C38r =: x:inv@:(x:@:identity@:# %. x:@:n38r"1)36br{.N3
i388 =: mp (C388 mp~ n388)
NB.i38k =: mp (C38k mp~ n38k)
i38q =: mp (C38r mp~ n38r)
i38r =: mp (C38r mp~ n38r)
</lang>
 
Anonymous user