Skip to content

lukashajdu/lissajous-curve-drawing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lissajous Curve Drawing

Generate animated GIFs of Lissajous curves using Imagick library.

Run example script:

// PHP build in server
php -S localhost:9999 example.php

Show image:

$lissajous = new LissajousCurveDrawing(
    new ImagickPixel('rgb(0, 255, 0)'),
    new ImagickPixel('rgb(127, 127, 127)'),
    new ImagickPixel('rgb(0, 0, 0)'),
    100
);

header('Content-Type: image/gif');
echo $lissajous->getDeltaTransformation(80, 80, 4)->getImagesBlob();

Save image to file:

$lissajous = new LissajousCurveDrawing(
    new ImagickPixel('rgb(0, 255, 0)'),
    new ImagickPixel('rgb(127, 127, 127)'),
    new ImagickPixel('rgb(0, 0, 0)'),
    100
);

$lissajous->getDeltaTransformation(80, 80, 4)->writeImages('curve.gif', true);

Example output:

Lissajous curve

About

Draw Lissajous curves using PHP and Imagick

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages