glVertex  5.5.2
Public Member Functions | List of all members
lgl_BezierCurve2D Class Reference

2D bezier curve More...

#include <glvertex_bezier.h>

Public Member Functions

 lgl_BezierCurve2D (vec2 a, vec2 b, bool lalign=true, bool ralign=true)
 create 2D bezier curve from 2 control points
 
 lgl_BezierCurve2D (vec2 a, vec2 b, vec2 c, vec2 d, bool lalign=true, bool ralign=true)
 create 2D bezier curve from 4 control points
 
vec2 start ()
 start point
 
vec2 end ()
 end point
 
double distance ()
 calculate distance of start and end point
 
vec2 evaluate (double w) const
 evaluate the 2D bezier curve
 
vec2 gradient (double w, int mode=0, double d=0.001) const
 evaluate the gradient of the 2D bezier curve
 
double length (int steps=100) const
 compute length of curve
 
void alignLeft (vec2 direction, lgl_BezierCurve2D *left=NULL, double factor=(sqrt(2.0) -1) *4/3)
 auto-align the left control point of the 2D bezier curve
 
void alignRight (vec2 direction, lgl_BezierCurve2D *right=NULL, double factor=(sqrt(2.0) -1) *4/3)
 auto-align the right control point of the 2D bezier curve
 
void alignCurves (lgl_BezierCurve2D *left, lgl_BezierCurve2D *right, double factor=(sqrt(2.0) -1) *4/3)
 auto-align the control points of the 2D bezier curve
 
void translate (vec2 v)
 translate curve
 
void rotate (double angle)
 rotate curve
 
void scale (vec2 s)
 scale curve
 

Detailed Description

2D bezier curve


The documentation for this class was generated from the following file: