Bezier |
Get() __construct() |
This class doesn't draw any graphs by itself it is only used to generate a new set of data points representing the smooth line from the input which are the control lines for a bezier interpolated curve.
The principle of using this class is that you first create an instance of this class and giving it the X,Y values for your control points.
You can then get back an interpolated smooth dataset by calling the Get() method. This method takeas as argument how many data points you want the interpolated graph to have.
In order to use this method the file jpgraph_regstat.php must be included.
Technical note: The control points for a bezier curve does not necessary lie on the curve. Using the alternative method of spline interpolation guarantees that the specified control point lie on the generated curve.
Technical note 2: An alternmative Bezier curve is also availabe in the Canvas tools (jpgraph_canvtools.php). The difference is that that method will not return any data points it will directly draw an interpolate bezier curve on the canvas.
Return two arrays of X and Y coordinates that represents the curve
Argument | Default | Description |
---|---|---|
$steps | Number of data points |
Example:
Create a new bezier object
Argument | Default | Description |
---|---|---|
$datax | X-coordinates for control points | |
$datay | Y-coordinates for control points | |
$attraction_factor | Attraction factor | |
No description available | ||
1 | No description available |
Example: