blob: 2e345ea3ffcb8d78c0b8f718ae6e31340d6d5012 [file] [log] [blame]
caryclark@google.com9e49fb62012-08-27 14:11:33 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
caryclark@google.com235f56a2012-09-14 14:19:30 +00007#if !defined CUBIC_UTILITIES_H
8#define CUBIC_UTILITIES_H
9
caryclark@google.com8dcf1142012-07-02 20:27:02 +000010#include "DataTypes.h"
caryclark@google.com6d0032a2013-01-04 19:41:13 +000011#include "SkTDArray.h"
caryclark@google.com8dcf1142012-07-02 20:27:02 +000012
caryclark@google.com27accef2012-01-25 18:57:23 +000013double cube_root(double x);
caryclark@google.com6d0032a2013-01-04 19:41:13 +000014int cubic_to_quadratics(const Cubic& cubic, SkTDArray<Quadratic>& quadratics);
caryclark@google.comc6825902012-02-03 22:07:47 +000015void coefficients(const double* cubic, double& A, double& B, double& C, double& D);
caryclark@google.com27accef2012-01-25 18:57:23 +000016int cubicRoots(double A, double B, double C, double D, double t[3]);
caryclark@google.com8dcf1142012-07-02 20:27:02 +000017double derivativeAtT(const double* cubic, double t);
18// competing version that should produce same results
19double derivativeAtT_2(const double* cubic, double t);
20void dxdy_at_t(const Cubic& , double t, double& x, double& y);
21bool rotate(const Cubic& cubic, int zero, int index, Cubic& rotPath);
22double secondDerivativeAtT(const double* cubic, double t);
23void xy_at_t(const Cubic& , double t, double& x, double& y);
caryclark@google.com235f56a2012-09-14 14:19:30 +000024
25#endif