2
* Copyright 2010 Inalogic Inc.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the applicable version of the GNU Lesser General Public
12
* License for more details.
14
* You should have received a copy of both the GNU Lesser General Public
15
* License version 3 along with this program. If not, see
16
* <http://www.gnu.org/licenses/>
18
* Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
26
#include "Constants.h"
31
//! Evaluate the Bernstein polynomial of degree n, at parameter t.
33
Evaluate the Bernstein polynomial of degree n, at parameter t.
35
@param n The degree of the Bernstein basis polynomials.
36
@param t The evaluation point.
38
@return the values of the n+1 Bernstein basis of degree n.
40
NUX_DECLSPEC_DLL t_double *Bernstein (t_int n, t_double t);
42
//! Evaluate 2D Bezier curve of degree n.
44
Evaluate 2D Bezier curve of degree n.
46
@param n The degree of the Bezier curve.
48
@param xcon Array of n+1 x coordinates of control points.
49
@param ycon Array of n+1 y coordinates of control points.
50
@param xval Return the x coordinates of the Bezier curve at parameter t.
51
@param yval Return the y coordinates of the Bezier curve at parameter t.
53
NUX_DECLSPEC_DLL void Bezier_XY (t_int n, t_double t, t_double xcon[], t_double ycon[], t_double *xval, t_double *yval);
55
//! Evaluate 2D Bezier curve of degree n.
57
Evaluate 2D Bezier curve of degree n.
59
@param n The degree of the Bezier curve.
61
@param xcon Array of n+1 x coordinates of control points.
62
@param ycon Array of n+1 y coordinates of control points.
63
@param ycon Array of n+1 z coordinates of control points.
64
@param xval Return the x coordinates of the Bezier curve at parameter t.
65
@param yval Return the y coordinates of the Bezier curve at parameter t.
66
@param yval Return the z coordinates of the Bezier curve at parameter t.
68
NUX_DECLSPEC_DLL void Bezier_XYZ (t_int n, t_double t, t_double xcon[], t_double ycon[], t_double zcon[], t_double *xval, t_double *yval, t_double *zval);