| * Copyright 2023 Google LLC |

| * Use of this source code is governed by a BSD-style license that can be |

| * found in the LICENSE file. |

| * Utilities for dealing with cubic formulas with one variable: |

| * f(t) = A*t^3 + B*t^2 + C*t + d |

| * Puts up to 3 real solutions to the equation |

| * A*t^3 + B*t^2 + C*t + d = 0 |

| static int RootsReal(double A, double B, double C, double D, |

| * Puts up to 3 real solutions to the equation |

| * A*t^3 + B*t^2 + C*t + d = 0 |

| * in the provided array, with the constraint that t is in the range [0.0, 1.0]. |

| static int RootsValidT(double A, double B, double C, double D, |

| * Evaluates the a cubic function with the 4 provided coefficients and the |

| static double EvalAt(double coefficients[4], double t) { |

| return coefficients[0] * t * t * t + |

| coefficients[1] * t * t + |