In the past, I used actionscript to dynamically draw trigonometric function curves. In fact, it is very simple to output trigonometric function curves in PHP.
//Send header information
header("Content-type: image/gif");
//Create image
$img = imageCreate(MAX_WIDTH_PIXEL, MAX_HEIGHT_PIXEL);
//Set color
$bgcolor = imageColorAllocate($img, 0xff, 0xe9, 0xe9);
$red = imageColorAllocate($img, 255, 0, 0);
$blue = imageColorAllocate($img, 0, 0, 255);
$brown = imageColorAllocate($img, 100, 0, 0);
$black = imageColorAllocate($img, 0, 0, 0);
$width = MAX_WIDTH_PIXEL/2; //Width
$height = MAX_HEIGHT_PIXEL/2; //Height
//Create coordinate axis
imageLine($img, $width, 0, $width, MAX_HEIGHT_PIXEL, $black); //y-axis
imageLine($img, 0, $height, MAX_WIDTH_PIXEL, $ height, $black);//x-axis
//Describe function graphics through loops
for($i=0; $i<=MAX_WIDTH_PIXEL; $i++)
{
$y1 = 100 * sin($i/100 * M_PI);
imageSetPixel($img, $i, $height+$y1, $blue);
$y2 = 100 * sin($i/300 * M_PI);
imageSetPixel($img, $i, $height+$y2, $red);
$y3 = 100 * sin($i/300 * M_PI);
imageSetPixel($img, $i, $height-$y3, $brown);
}
//Display graphics
imageGif($img);
//Release resources
imageDestroy($img);
/*==Hermit Bird==*/
?>