1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_GFX_GEOMETRY_CUBIC_BEZIER_H_
6 #define UI_GFX_GEOMETRY_CUBIC_BEZIER_H_
8 #include "base/macros.h"
9 #include "ui/gfx/gfx_export.h"
13 class GFX_EXPORT CubicBezier
{
15 CubicBezier(double x1
, double y1
, double x2
, double y2
);
18 // Returns an approximation of y at the given x.
19 double Solve(double x
) const;
21 // Returns an approximation of dy/dx at the given x.
22 double Slope(double x
) const;
24 // Sets |min| and |max| to the bezier's minimum and maximium y values in the
26 void Range(double* min
, double* max
) const;
36 double start_gradient_
;
39 DISALLOW_ASSIGN(CubicBezier
);
44 #endif // UI_GFX_GEOMETRY_CUBIC_BEZIER_H_