Knowledge

Tricubic interpolation

Source 📝

1317: 710: 1312:{\displaystyle {\begin{aligned}s(i,j,k)&{}={\text{The value at grid point }}(i,j,k)\\t(i,j,z)&{}=\mathrm {CINT} _{z}\left(s(i,j,-1),s(i,j,0),s(i,j,1),s(i,j,2)\right)\\u(i,y,z)&{}=\mathrm {CINT} _{y}\left(t(i,-1,z),t(i,0,z),t(i,1,z),t(i,2,z)\right)\\f(x,y,z)&{}=\mathrm {CINT} _{x}\left(u(-1,y,z),u(0,y,z),u(1,y,z),u(2,y,z)\right)\end{aligned}}} 241:
is used in more than one context; some experiments measure both the value of a function and its spatial derivatives, and it is desirable to interpolate preserving the values and the measured derivatives at the grid points. Those provide 32 constraints on the coefficients, and another 32 constraints
1496:
matrix described in Lekien and Marsden. However, a proper implementation using a sparse format for the matrix (that is fairly sparse) makes the latter more efficient. This aspect is even much more pronounced when interpolation is needed at several locations inside the same cube. In this case, the
654: 1525:
matrix is used once to compute the interpolation coefficients for the entire cube. The coefficients are then stored and used for interpolation at any location inside the cube. In comparison, sequential use of one-dimensional integrators
245:
In other contexts, we can obtain the 64 coefficients by considering a 3×3×3 grid of small cubes surrounding the cube inside which we evaluate the function, and fitting the function at the 64 points on the corners of this grid.
193: 347: 715: 483: 1382: 42: 1562: 683: 1466: 1523: 1494: 1432: 228: 377: 458: 431: 404: 703: 478: 1683: 256: 1564:
performs extremely poorly for repeated interpolations because each computational step must be repeated for each new location.
649:{\displaystyle \mathrm {CINT} _{x}(u_{-1},u_{0},u_{1},u_{2})=\mathbf {v} _{x}\cdot \left(u_{-1},u_{0},u_{1},u_{2}\right)} 253:
article indicates that the method is equivalent to a sequential application of one-dimensional cubic interpolators. Let
1653: 1583: 32: 1322: 231: 1529: 1578: 659: 1440: 1573: 1500: 1471: 250: 16:
Method for obtaining values at arbitrary points in 3D space of a function defined on a regular grid
1606: 24: 1387: 1628: 200: 188:{\displaystyle f(x,y,z)=\sum _{i=0}^{3}\sum _{j=0}^{3}\sum _{k=0}^{3}a_{ijk}x^{i}y^{j}z^{k}.} 1618: 352: 436: 409: 382: 39:. The approach involves approximating the function locally by an expression of the form 688: 463: 1677: 36: 20: 1658: 1668: 1632: 349:
be the value of a monovariable cubic polynomial (e.g. constrained by values,
1663: 1648: 1437:
At first glance, it might seem more convenient to use the 21 calls to
1623: 234:
at a point places one linear constraint on the 64 coefficients.
242:
can be provided by requiring smoothness of higher derivatives.
480:. In many useful cases, these cubic polynomials have the form 342:{\displaystyle \mathrm {CINT} _{x}(a_{-1},a_{0},a_{1},a_{2})} 230:; requiring the function to have a given value or given 31:
is a method for obtaining values at arbitrary points in
1532: 1503: 1474: 1443: 1390: 1325: 713: 691: 662: 486: 466: 439: 412: 385: 355: 259: 203: 45: 705:alone. The tricubic interpolator is equivalent to: 1556: 1517: 1488: 1460: 1426: 1376: 1311: 697: 677: 648: 472: 452: 425: 398: 371: 341: 222: 187: 1649:Java/C++ implementation of tricubic interpolation 8: 1654:C++ implementation of tricubic interpolation 1607:"Tricubic interpolation in three dimensions" 1371: 1344: 1611:Journal of Numerical Methods in Engineering 460:from consecutive grid points) evaluated at 1622: 1548: 1534: 1531: 1504: 1502: 1475: 1473: 1444: 1442: 1389: 1324: 1181: 1167: 1161: 1005: 991: 985: 829: 815: 809: 751: 746: 714: 712: 690: 669: 664: 661: 635: 622: 609: 593: 575: 570: 557: 544: 531: 515: 502: 488: 485: 465: 444: 438: 417: 411: 390: 384: 360: 354: 330: 317: 304: 288: 275: 261: 258: 208: 202: 176: 166: 156: 140: 130: 119: 109: 98: 88: 77: 44: 1594: 1605:Lekien, F.; Marsden, J. (2005-05-21). 1377:{\displaystyle i,j,k\in \{-1,0,1,2\}} 7: 1600: 1598: 1557:{\displaystyle \mathrm {CINT} _{x}} 1544: 1541: 1538: 1535: 1454: 1451: 1448: 1445: 1177: 1174: 1171: 1168: 1001: 998: 995: 992: 825: 822: 819: 816: 498: 495: 492: 489: 271: 268: 265: 262: 14: 678:{\displaystyle \mathbf {v} _{x}} 665: 571: 1468:described above instead of the 1461:{\displaystyle \mathrm {CINT} } 1421: 1409: 1297: 1279: 1270: 1252: 1243: 1225: 1216: 1195: 1154: 1136: 1121: 1103: 1094: 1076: 1067: 1049: 1040: 1019: 978: 960: 945: 927: 918: 900: 891: 873: 864: 843: 802: 784: 774: 756: 739: 721: 563: 508: 336: 281: 197:This form has 64 coefficients 67: 49: 1: 1518:{\displaystyle {64\times 64}} 1489:{\displaystyle {64\times 64}} 753:The value at grid point  35:of a function defined on a 1700: 1684:Multivariate interpolation 1427:{\displaystyle x,y,z\in } 1584:Trilinear interpolation 685:which is a function of 223:{\displaystyle a_{ijk}} 1558: 1519: 1490: 1462: 1428: 1378: 1313: 699: 679: 650: 474: 454: 427: 400: 373: 372:{\displaystyle a_{-1}} 343: 239:tricubic interpolation 232:directional derivative 224: 189: 135: 114: 93: 29:tricubic interpolation 1659:Python implementation 1579:Bicubic interpolation 1559: 1520: 1491: 1463: 1429: 1379: 1314: 700: 680: 651: 475: 455: 453:{\displaystyle a_{2}} 428: 426:{\displaystyle a_{1}} 401: 399:{\displaystyle a_{0}} 374: 344: 225: 190: 115: 94: 73: 1664:NumPy implementation 1530: 1501: 1472: 1441: 1388: 1323: 711: 689: 660: 484: 464: 437: 410: 383: 353: 257: 201: 43: 1574:Cubic interpolation 251:cubic interpolation 1554: 1515: 1486: 1458: 1424: 1374: 1309: 1307: 695: 675: 646: 470: 450: 423: 396: 369: 339: 220: 185: 25:numerical analysis 1670:einspline library 754: 698:{\displaystyle x} 473:{\displaystyle x} 1691: 1637: 1636: 1626: 1624:10.1002/nme.1296 1602: 1563: 1561: 1560: 1555: 1553: 1552: 1547: 1524: 1522: 1521: 1516: 1514: 1495: 1493: 1492: 1487: 1485: 1467: 1465: 1464: 1459: 1457: 1433: 1431: 1430: 1425: 1383: 1381: 1380: 1375: 1318: 1316: 1315: 1310: 1308: 1304: 1300: 1186: 1185: 1180: 1162: 1128: 1124: 1010: 1009: 1004: 986: 952: 948: 834: 833: 828: 810: 755: 752: 747: 704: 702: 701: 696: 684: 682: 681: 676: 674: 673: 668: 656:for some vector 655: 653: 652: 647: 645: 641: 640: 639: 627: 626: 614: 613: 601: 600: 580: 579: 574: 562: 561: 549: 548: 536: 535: 523: 522: 507: 506: 501: 479: 477: 476: 471: 459: 457: 456: 451: 449: 448: 432: 430: 429: 424: 422: 421: 405: 403: 402: 397: 395: 394: 378: 376: 375: 370: 368: 367: 348: 346: 345: 340: 335: 334: 322: 321: 309: 308: 296: 295: 280: 279: 274: 229: 227: 226: 221: 219: 218: 194: 192: 191: 186: 181: 180: 171: 170: 161: 160: 151: 150: 134: 129: 113: 108: 92: 87: 1699: 1698: 1694: 1693: 1692: 1690: 1689: 1688: 1674: 1673: 1645: 1640: 1604: 1603: 1596: 1592: 1570: 1533: 1528: 1527: 1499: 1498: 1470: 1469: 1439: 1438: 1386: 1385: 1321: 1320: 1306: 1305: 1191: 1187: 1166: 1157: 1130: 1129: 1015: 1011: 990: 981: 954: 953: 839: 835: 814: 805: 778: 777: 742: 709: 708: 687: 686: 663: 658: 657: 631: 618: 605: 589: 588: 584: 569: 553: 540: 527: 511: 487: 482: 481: 462: 461: 440: 435: 434: 413: 408: 407: 386: 381: 380: 356: 351: 350: 326: 313: 300: 284: 260: 255: 254: 204: 199: 198: 172: 162: 152: 136: 41: 40: 17: 12: 11: 5: 1697: 1695: 1687: 1686: 1676: 1675: 1672: 1671: 1666: 1661: 1656: 1651: 1644: 1643:External links 1641: 1639: 1638: 1617:(3): 455–471. 1593: 1591: 1588: 1587: 1586: 1581: 1576: 1569: 1566: 1551: 1546: 1543: 1540: 1537: 1513: 1510: 1507: 1484: 1481: 1478: 1456: 1453: 1450: 1447: 1423: 1420: 1417: 1414: 1411: 1408: 1405: 1402: 1399: 1396: 1393: 1373: 1370: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1343: 1340: 1337: 1334: 1331: 1328: 1303: 1299: 1296: 1293: 1290: 1287: 1284: 1281: 1278: 1275: 1272: 1269: 1266: 1263: 1260: 1257: 1254: 1251: 1248: 1245: 1242: 1239: 1236: 1233: 1230: 1227: 1224: 1221: 1218: 1215: 1212: 1209: 1206: 1203: 1200: 1197: 1194: 1190: 1184: 1179: 1176: 1173: 1170: 1165: 1160: 1158: 1156: 1153: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1131: 1127: 1123: 1120: 1117: 1114: 1111: 1108: 1105: 1102: 1099: 1096: 1093: 1090: 1087: 1084: 1081: 1078: 1075: 1072: 1069: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1039: 1036: 1033: 1030: 1027: 1024: 1021: 1018: 1014: 1008: 1003: 1000: 997: 994: 989: 984: 982: 980: 977: 974: 971: 968: 965: 962: 959: 956: 955: 951: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 896: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 851: 848: 845: 842: 838: 832: 827: 824: 821: 818: 813: 808: 806: 804: 801: 798: 795: 792: 789: 786: 783: 780: 779: 776: 773: 770: 767: 764: 761: 758: 750: 745: 743: 741: 738: 735: 732: 729: 726: 723: 720: 717: 716: 694: 672: 667: 644: 638: 634: 630: 625: 621: 617: 612: 608: 604: 599: 596: 592: 587: 583: 578: 573: 568: 565: 560: 556: 552: 547: 543: 539: 534: 530: 526: 521: 518: 514: 510: 505: 500: 497: 494: 491: 469: 447: 443: 420: 416: 393: 389: 366: 363: 359: 338: 333: 329: 325: 320: 316: 312: 307: 303: 299: 294: 291: 287: 283: 278: 273: 270: 267: 264: 217: 214: 211: 207: 184: 179: 175: 169: 165: 159: 155: 149: 146: 143: 139: 133: 128: 125: 122: 118: 112: 107: 104: 101: 97: 91: 86: 83: 80: 76: 72: 69: 66: 63: 60: 57: 54: 51: 48: 15: 13: 10: 9: 6: 4: 3: 2: 1696: 1685: 1682: 1681: 1679: 1669: 1667: 1665: 1662: 1660: 1657: 1655: 1652: 1650: 1647: 1646: 1642: 1634: 1630: 1625: 1620: 1616: 1612: 1608: 1601: 1599: 1595: 1589: 1585: 1582: 1580: 1577: 1575: 1572: 1571: 1567: 1565: 1549: 1511: 1508: 1505: 1482: 1479: 1476: 1435: 1418: 1415: 1412: 1406: 1403: 1400: 1397: 1394: 1391: 1368: 1365: 1362: 1359: 1356: 1353: 1350: 1347: 1341: 1338: 1335: 1332: 1329: 1326: 1301: 1294: 1291: 1288: 1285: 1282: 1276: 1273: 1267: 1264: 1261: 1258: 1255: 1249: 1246: 1240: 1237: 1234: 1231: 1228: 1222: 1219: 1213: 1210: 1207: 1204: 1201: 1198: 1192: 1188: 1182: 1163: 1159: 1151: 1148: 1145: 1142: 1139: 1133: 1125: 1118: 1115: 1112: 1109: 1106: 1100: 1097: 1091: 1088: 1085: 1082: 1079: 1073: 1070: 1064: 1061: 1058: 1055: 1052: 1046: 1043: 1037: 1034: 1031: 1028: 1025: 1022: 1016: 1012: 1006: 987: 983: 975: 972: 969: 966: 963: 957: 949: 942: 939: 936: 933: 930: 924: 921: 915: 912: 909: 906: 903: 897: 894: 888: 885: 882: 879: 876: 870: 867: 861: 858: 855: 852: 849: 846: 840: 836: 830: 811: 807: 799: 796: 793: 790: 787: 781: 771: 768: 765: 762: 759: 748: 744: 736: 733: 730: 727: 724: 718: 706: 692: 670: 642: 636: 632: 628: 623: 619: 615: 610: 606: 602: 597: 594: 590: 585: 581: 576: 566: 558: 554: 550: 545: 541: 537: 532: 528: 524: 519: 516: 512: 503: 467: 445: 441: 418: 414: 391: 387: 364: 361: 357: 331: 327: 323: 318: 314: 310: 305: 301: 297: 292: 289: 285: 276: 252: 247: 243: 240: 235: 233: 215: 212: 209: 205: 195: 182: 177: 173: 167: 163: 157: 153: 147: 144: 141: 137: 131: 126: 123: 120: 116: 110: 105: 102: 99: 95: 89: 84: 81: 78: 74: 70: 64: 61: 58: 55: 52: 46: 38: 34: 30: 26: 22: 1614: 1610: 1436: 707: 248: 244: 238: 236: 196: 37:regular grid 28: 21:mathematical 18: 1590:References 1633:0029-5981 1509:× 1480:× 1407:∈ 1348:− 1342:∈ 1199:− 1029:− 859:− 595:− 582:⋅ 517:− 362:− 290:− 237:The term 117:∑ 96:∑ 75:∑ 23:subfield 1678:Category 1568:See also 33:3D space 19:In the 1631:  1319:where 1629:ISSN 1384:and 249:The 1619:doi 1680:: 1627:. 1615:63 1613:. 1609:. 1597:^ 1512:64 1506:64 1483:64 1477:64 1434:. 433:, 406:, 379:, 27:, 1635:. 1621:: 1550:x 1545:T 1542:N 1539:I 1536:C 1455:T 1452:N 1449:I 1446:C 1422:] 1419:1 1416:, 1413:0 1410:[ 1404:z 1401:, 1398:y 1395:, 1392:x 1372:} 1369:2 1366:, 1363:1 1360:, 1357:0 1354:, 1351:1 1345:{ 1339:k 1336:, 1333:j 1330:, 1327:i 1302:) 1298:) 1295:z 1292:, 1289:y 1286:, 1283:2 1280:( 1277:u 1274:, 1271:) 1268:z 1265:, 1262:y 1259:, 1256:1 1253:( 1250:u 1247:, 1244:) 1241:z 1238:, 1235:y 1232:, 1229:0 1226:( 1223:u 1220:, 1217:) 1214:z 1211:, 1208:y 1205:, 1202:1 1196:( 1193:u 1189:( 1183:x 1178:T 1175:N 1172:I 1169:C 1164:= 1155:) 1152:z 1149:, 1146:y 1143:, 1140:x 1137:( 1134:f 1126:) 1122:) 1119:z 1116:, 1113:2 1110:, 1107:i 1104:( 1101:t 1098:, 1095:) 1092:z 1089:, 1086:1 1083:, 1080:i 1077:( 1074:t 1071:, 1068:) 1065:z 1062:, 1059:0 1056:, 1053:i 1050:( 1047:t 1044:, 1041:) 1038:z 1035:, 1032:1 1026:, 1023:i 1020:( 1017:t 1013:( 1007:y 1002:T 999:N 996:I 993:C 988:= 979:) 976:z 973:, 970:y 967:, 964:i 961:( 958:u 950:) 946:) 943:2 940:, 937:j 934:, 931:i 928:( 925:s 922:, 919:) 916:1 913:, 910:j 907:, 904:i 901:( 898:s 895:, 892:) 889:0 886:, 883:j 880:, 877:i 874:( 871:s 868:, 865:) 862:1 856:, 853:j 850:, 847:i 844:( 841:s 837:( 831:z 826:T 823:N 820:I 817:C 812:= 803:) 800:z 797:, 794:j 791:, 788:i 785:( 782:t 775:) 772:k 769:, 766:j 763:, 760:i 757:( 749:= 740:) 737:k 734:, 731:j 728:, 725:i 722:( 719:s 693:x 671:x 666:v 643:) 637:2 633:u 629:, 624:1 620:u 616:, 611:0 607:u 603:, 598:1 591:u 586:( 577:x 572:v 567:= 564:) 559:2 555:u 551:, 546:1 542:u 538:, 533:0 529:u 525:, 520:1 513:u 509:( 504:x 499:T 496:N 493:I 490:C 468:x 446:2 442:a 419:1 415:a 392:0 388:a 365:1 358:a 337:) 332:2 328:a 324:, 319:1 315:a 311:, 306:0 302:a 298:, 293:1 286:a 282:( 277:x 272:T 269:N 266:I 263:C 216:k 213:j 210:i 206:a 183:. 178:k 174:z 168:j 164:y 158:i 154:x 148:k 145:j 142:i 138:a 132:3 127:0 124:= 121:k 111:3 106:0 103:= 100:j 90:3 85:0 82:= 79:i 71:= 68:) 65:z 62:, 59:y 56:, 53:x 50:( 47:f

Index

mathematical
numerical analysis
3D space
regular grid
directional derivative
cubic interpolation
Cubic interpolation
Bicubic interpolation
Trilinear interpolation


"Tricubic interpolation in three dimensions"
doi
10.1002/nme.1296
ISSN
0029-5981
Java/C++ implementation of tricubic interpolation
C++ implementation of tricubic interpolation
Python implementation
NumPy implementation

Category
Multivariate interpolation

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.