39 lines
858 B
JSON
39 lines
858 B
JSON
{
|
|
"name": "LinearInterp",
|
|
"summary": "The value at X on the straight line through (X0, Y0) and (X1, Y1).",
|
|
"tags": [
|
|
"interpolation"
|
|
],
|
|
"sources": [
|
|
{
|
|
"title": "NIST Digital Library of Mathematical Functions, section 3.3(ii), linear interpolation (equation 3.3.14)",
|
|
"url": "https://dlmf.nist.gov/3.3.ii"
|
|
}
|
|
],
|
|
"cases": [
|
|
{
|
|
"call": "LinearInterp(0.0, 0.0, 10.0, 5.0, 4.0)"
|
|
},
|
|
{
|
|
"call": "LinearInterp(1.0, 2.0, 3.0, 2.0, 2.5)"
|
|
},
|
|
{
|
|
"call": "LinearInterp(0.0, 1.0, 1.0, 3.0, 2.0)"
|
|
}
|
|
],
|
|
"references": [
|
|
{
|
|
"lang": "python",
|
|
"level": "plain",
|
|
"file": "ref/python/plain.py",
|
|
"note": "The same formula."
|
|
},
|
|
{
|
|
"lang": "mojo",
|
|
"level": "plain",
|
|
"file": "ref/mojo/plain.mojo",
|
|
"note": "The same formula in Mojo."
|
|
}
|
|
]
|
|
}
|