Smrender
 All Data Structures Files Functions Variables Macros
Macros | Functions
bspline_ctrl.c File Reference
#include <cairo.h>
#include <math.h>
#include "bspline.h"
Include dependency graph for bspline_ctrl.c:

Functions

void control_points (const line_t *g, const line_t *l, point_t *p1, point_t *p2, double f)
 

Detailed Description

This file contains the functions to calculate control points from a list of points for drawing bezier curves.

Author
Bernhard R. Fischer
Version
2015/11/30

Function Documentation

void control_points ( const line_t g,
const line_t l,
point_t p1,
point_t p2,
double  f 
)

This function calculates the control points. It takes two lines g and l as arguments but it takes three lines into account for calculation. This is line g (P0/P1), line h (P1/P2), and line l (P2/P3). The control points being calculated are actually those for the middle line h, this is from P1 to P2. Line g is the predecessor and line l the successor of line h.

Parameters
gPointer to first line.
lPointer to third line (the second line is connecting g and l).
p1Pointer to memory of first control point. This will receive the coordinates.
p2Pointer to memory of second control point.