BezierCurve library

Evaluate Bezier curves.

File:
BezierCurve.lib
Version:
1.0
Author:
Marcus Johansson

Contents

Details
Sub routines


Details

This library evaluates points and derivatives on quadratic and cubic two dimensional Bezier curves.


Subroutines

Name
Parameters
Brief description
function
QB_Evaluate#[]
&cp#[][], param#
Get point on quadratic curve.
function
QB_EvaluateX#[]
&cp#[][], param#
Get x coordinate of point on quadratic curve.
function
QB_EvaluateY#[]
&cp#[][], param#
Get y coordinate of point on quadratic curve.
function
QB_EvaluateDeriv#[]
&cp#[][], param#, normalize
Get derivative at point on quadratic curve.
function
QB_EvaluateDX#[]
&cp#[][], param#, normalize
Get derivative x component at point on quadratic curve.
function
QB_EvaluateDY#[]
&cp#[][], param#, normalize
Get derivative y component at point on quadratic curve.
function
CB_Evaluate#[]
&cp#[][], param#
Get point on cubic curve.
function
CB_EvaluateX#[]
&cp#[][], param#
Get x coordinate of point on cubic curve.
function
CB_EvaluateY#[]
&cp#[][], param#
Get y coordinate of point on cubic curve.
function
CB_EvaluateDeriv#[]
&cp#[][], param#, normalize
Get derivative at point on cubic curve.
function
CB_EvaluateDX#[]
&cp#[][], param#, normalize
Get derivative x component at point on cubic curve.
function
CB_EvaluateDY#[]
&cp#[][], param#, normalize
Get derivative y component at point on cubic curve.


Subroutine documentation

function QB_Evaluate#[] ( &cp#[][], param# )

Return point [x, y] at parameter 'param' [0..1] on the quadratic curve defined by the control points in 'cp' as [[x1, y1], [x2, y2], [x3, y3]].

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Point.

[ Back ]


function QB_EvaluateX#[] ( &cp#[][], param# )

Return x coordinate at parameter 'param' [0..1] on the quadratic curve defined by the control points in 'cp' as [[x1, y1], [x2, y2], [x3, y3]].

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
X coordinate.

[ Back ]


function QB_EvaluateY#[] ( &cp#[][], param# )

Return y coordinate at parameter 'param' [0..1] on the quadratic curve defined by the control points in 'cp' as [[x1, y1], [x2, y2], [x3, y3]].

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Y coordinate.

[ Back ]


function QB_EvaluateDeriv#[] ( &cp#[][], param#, normalize )

Return derivative (curve direction) [dx, dy] at parameter 'param' on the quadratic curve defined by the control points 'cp' as [[x1, y1], [x2, y2], [x3, y3]]. If 'normalized' is set to true, the returned vector will be normalized.

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Derivative.

[ Back ]


function QB_EvaluateDX#[] ( &cp#[][], param#, normalize )

Return x component of derivative (curve direction) [dx, dy] at parameter 'param' on the quadratic curve defined by the control points 'cp' as [[x1, y1], [x2, y2], [x3, y3]]. If 'normalized' is set to true, the returned component will be from a normalized vector.

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
X component of derivative.

[ Back ]


function QB_EvaluateDY#[] ( &cp#[][], param#, normalize )

Return y component of derivative (curve direction) [dx, dy] at parameter 'param' on the quadratic curve defined by the control points 'cp' as [[x1, y1], [x2, y2], [x3, y3]]. If 'normalized' is set to true, the returned component will be from a normalized vector.

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Y component of derivative.

[ Back ]


function CB_Evaluate#[] ( &cp#[][], param# )

Return point [x, y] at parameter 'param' [0..1] on the cubic curve defined by the control points in 'cp' as [[x1, y1], [x2, y2], [x3, y3], [x4, y4]].

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Point.

[ Back ]


function CB_EvaluateX#[] ( &cp#[][], param# )

Return x coordinate at parameter 'param' [0..1] on the cubic curve defined by the control points in 'cp' as [[x1, y1], [x2, y2], [x3, y3], [x4, y4]].

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
X coordinate.

[ Back ]


function CB_EvaluateY#[] ( &cp#[][], param# )

Return y coordinate at parameter 'param' [0..1] on the cubic curve defined by the control points in 'cp' as [[x1, y1], [x2, y2], [x3, y3], [x4, y4]].

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Y coordinate.

[ Back ]


function CB_EvaluateDeriv#[] ( &cp#[][], param#, normalize )

Return derivative (curve direction) [dx, dy] at parameter 'param' on the cubic curve defined by the control points 'cp' as [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]. If 'normalized' is set to true, the returned vector will be normalized.

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Derivative.

[ Back ]


function CB_EvaluateDX#[] ( &cp#[][], param#, normalize )

Return x component of derivative (curve direction) [dx, dy] at parameter 'param' on the cubic curve defined by the control points 'cp' as [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]. If 'normalized' is set to true, the returned component will be from a normalized vector.

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
X component of derivative.

[ Back ]


function CB_EvaluateDY#[] ( &cp#[][], param#, normalize )

Return y component of derivative (curve direction) [dx, dy] at parameter 'param' on the cubic curve defined by the control points 'cp' as [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]. If 'normalized' is set to true, the returned component will be from a normalized vector.

Parameter
Mode
Description
cp
In
Control points.
param
In
Parameter.

Return value
Y component of derivative.

[ Back ]


Generated with NLDoc 20140630.