~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to NuxCore/Math/Bezier.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-11-18 19:17:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101118191732-rn35790vekj6o4my
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 Inalogic Inc.
 
3
 *
 
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.
 
7
 *
 
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.
 
13
 *
 
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/>
 
17
 *
 
18
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#ifndef BEZIER_H
 
24
#define BEZIER_H
 
25
 
 
26
#include "Constants.h"
 
27
 
 
28
namespace nux
 
29
{
 
30
 
 
31
//! Evaluate the Bernstein polynomial of degree n, at parameter t.
 
32
  /*!
 
33
      Evaluate the Bernstein polynomial of degree n, at parameter t.
 
34
 
 
35
      @param n The degree of the Bernstein basis polynomials.
 
36
      @param t The evaluation point.
 
37
 
 
38
      @return the values of the n+1 Bernstein basis of degree n.
 
39
  */
 
40
  NUX_DECLSPEC_DLL t_double *Bernstein (t_int n, t_double t);
 
41
 
 
42
//! Evaluate 2D Bezier curve of degree n.
 
43
  /*!
 
44
      Evaluate 2D Bezier curve of degree n.
 
45
 
 
46
      @param n The degree of the Bezier curve.
 
47
      @param t Parameter.
 
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.
 
52
  */
 
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);
 
54
 
 
55
//! Evaluate 2D Bezier curve of degree n.
 
56
  /*!
 
57
      Evaluate 2D Bezier curve of degree n.
 
58
 
 
59
      @param n The degree of the Bezier curve.
 
60
      @param t Parameter.
 
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.
 
67
  */
 
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);
 
69
 
 
70
 
 
71
 
 
72
}
 
73
 
 
74
#endif // BEZIER_H
 
75
 
 
76