PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Mikhail   SVG math functions graphics   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example of creating svg graph of cosinus function
Class: SVG math functions graphics
Render a math formula as a SVG vectorial chart
Author: By
Last change: added example of drawing graphics with dots
Date: 11 years ago
Size: 747 bytes


Class file image Download
$Xcoord = array(10,20,300,200,25,47,55,90);
$Ycoord = array(20,60,80,100,120,140,11,160);
$dots = array($Xcoord,$Ycoord);

$data = array (
'dimens' => "300x300",
'func' => '100*sin(8*x)', //instead of function here you can use array of dots ($dots in this example)
'step' => pi, //please use pi for polar coordinates
'brush_color' => 'red',
'system' => 'polar', // you can use polar or cartesian
'brush_width' => 0.2
$graph = new svg_graph($data);