---
name: "CL_BezierCurve"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_BezierCurve"
---

# CL\_BezierCurve(3)

Class for Bezier curves

## NAME

CL\_BezierCurve - Class for Bezier curves

## DESCRIPTION

This class generates points on a Bezier curve from given control points

## CLASS MEMBERS

- **CL\_BezierCurve**(

  ```
  const CL_Vector *cp,
  int cs,
  int steps,
  bool stepping = true)
  ```

- virtual **~CL\_BezierCurve**()

  - virtual int **get\_steps**()

  - virtual int **get\_cs**()

  - virtual bool **get\_stepping**()

  - virtual float **get\_length**(

  ```
  int segment = -1)
  ```

- virtual void **set\_steps**(

  ```
  int steps)
  ```

- virtual void **set\_stepping**(

  ```
  bool stepping)
  ```

- virtual CL\_Vector\* **get\_curve**()

  - virtual CL\_Vector\* **get\_control\_points**()

  - CL\_Vector **operator \[\]**(

  ```
  int n)
  ```

## MEMBERS WITH DESCRIPTIONS

- **CL\_BezierCurve**(

  ```
  const CL_Vector *cp,
  int cs,
  int steps,
  bool stepping = true)
  ```

  ```
  Parameters:
  cp - an array of control points with size (4 * cs)
  cs - number of curve segments
  steps - number of points to generate
  stepping - whether steps is the number of points per segment or per curve.
  ```

  ```
  Description:
  ```

  Constructor

- virtual **~CL\_BezierCurve**()

  ```
  Description:
  ```

  Destructor

- virtual int **get\_steps**()

  ```
  Description:
  ```

  Returns the number of steps

  ```
  Return value:
  ```

  number of steps

- virtual int **get\_cs**()

  ```
  Description:
  ```

  Returns the number of curve segments

  ```
  Return value:
  ```

  number of curve segments

- virtual bool **get\_stepping**()

  ```
  Description:
  ```

  Returns whether steps is the number of points per segment or per curve.

  ```
  Return value:
  ```

  stepping

- virtual float **get\_length**(

  ```
  int segment = -1)
  ```

  ```
  Parameters:
  segment - number of segment (-1 indicates whole curve)
  ```

  ```
  Description:
  ```

  Returns the lenght of a segment (or the curve)

  ```
  Return value:
  ```

  length of segment (or curve)

- virtual void **set\_steps**(

  ```
  int steps)
  ```

  ```
  Parameters:
  steps - number of steps
  ```

  ```
  Description:
  ```

  Sets the number of steps

- virtual void **set\_stepping**(

  ```
  bool stepping)
  ```

  ```
  Parameters:
  stepping - whether steps is the number of points per segment or per curve.
  ```

  ```
  Description:
  ```

  Sets the stepping

- virtual CL\_Vector\* **get\_curve**()

  ```
  Description:
  ```

  Returns an array of cs \* steps CL\_Vectors -\> the curve

  ```
  Return value:
  ```

  the curve (cs \* steps CL\_Vectors)

- virtual CL\_Vector\* **get\_control\_points**()

  ```
  Description:
  ```

  Returns the 4 \* cs control points

  ```
  Return value:
  ```

  the 4 \* cs control points

- CL\_Vector **operator \[\]**(

  ```
  int n)
  ```

  ```
  Parameters:
  n - the vector to return (counting starts at 0)
  ```

  ```
  Description:
  ```

  Returns the n-th vector of the curve (\_doesn't\_ return a reference)

  ```
  Return value:
  ```

  the n-th vector of the curve (\_doesn't\_ return a reference)

## SEE ALSO

All ClanLib API classes can be found in **clanlib (3)**.

## AUTHORS

Originally written by Magnus Norddahl \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at **http://somewhere.in.the.world.org**).

See **clanlib (3)** to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.
