{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $x_0 \u003c x_1 \u003c \\cdots \u003c x_n$ be real nodes, and let $p_0, \\dots, p_n$ and $m_0, \\dots, m_n$ be real numbers.\nLet $h_i = x_{i+1} - x_i$.\nThe *cubic Hermite spline* for these data is the function $s \\colon [x_0, x_n] \\to \\R$ given on each $[x_i, x_{i+1}]$ by\n$$s(x) = h_{00}(u)\\, p_i + h_{10}(u)\\, h_i m_i + h_{01}(u)\\, p_{i+1} + h_{11}(u)\\, h_i m_{i+1},$$\nwhere $u = (x - x_i)/h_i$ and\n$$h_{00}(u) = 2u^3 - 3u^2 + 1, \\quad h_{10}(u) = u^3 - 2u^2 + u, \\quad h_{01}(u) = -2u^3 + 3u^2, \\quad h_{11}(u) = u^3 - u^2.$$\n\n## Remarks\n\nThe piece on $[x_i, x_{i+1}]$ is the unique cubic with $s(x_i) = p_i$, $s'(x_i) = m_i$, $s(x_{i+1}) = p_{i+1}$ and $s'(x_{i+1}) = m_{i+1}$, that is, a [[Hermite interpolant|9Z50M2WPTP]].\nCheck: $h_{00}(0) = 1$, $h_{00}(1) = 0$, $h_{01}(1) = 1$, $h_{10}'(0) = 1$, $h_{11}'(1) = 1$, and the other values and slopes at $0$ and $1$ vanish.\nSo $s$ is a [[spline|84TJ8KQ926]] of class [[$C^1$|0VW90BBSJ4]], but in general not of class $C^2$.\nExample: nodes $0, 1$ with $p = (0, 1)$ and $m = (0, 0)$ give $s(x) = 3x^2 - 2x^3$.\nNon-example: the piecewise linear interpolant of the same values is not a cubic Hermite spline for these slopes, since its slope on $[0, 1]$ is $1$, not $0$.\nWhen the slopes are not given, they are chosen from the values, for instance by finite differences (Catmull–Rom spline) or by monotonicity-preserving rules.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "HCQWPAHYAT",
    "kind": "definition",
    "msc": [
      "41A15",
      "65D07",
      "41A05"
    ],
    "name": "Cubic Hermite spline",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Cubic_Hermite_spline"
      }
    ],
    "tag": "Z45HQ5VNF4",
    "uses": [
      "9Z50M2WPTP",
      "84TJ8KQ926",
      "0VW90BBSJ4"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/Z45HQ5VNF4/",
  "links": [
    {
      "field": "defines",
      "target": "HCQWPAHYAT"
    },
    {
      "field": "uses",
      "target": "9Z50M2WPTP"
    },
    {
      "field": "uses",
      "target": "84TJ8KQ926"
    },
    {
      "field": "uses",
      "target": "0VW90BBSJ4"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/Z45HQ5VNF4.md",
  "msc": [
    "41A15",
    "65D07",
    "41A05"
  ],
  "name": "Cubic Hermite spline",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/Z45/Z45HQ5VNF4.md",
  "status": null,
  "tag": "Z45HQ5VNF4",
  "uri": "m2://Z45HQ5VNF4",
  "url": "https://tamnd.github.io/math2/wiki/cubic-hermite-spline-definition/",
  "writing": {
    "tag": "Z45HQ5VNF4",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
