Shop More Submit  Join Login
×



Details

Submitted on
July 23, 2009
Image Size
523 KB
Resolution
1024×1024
Link
Thumb
Embed

Stats

Views
500
Favourites
2 (who?)
Comments
6
Downloads
42

License

Creative Commons License
Some rights reserved. This work is licensed under a
Creative Commons Attribution 3.0 License.
×
Fire Flower by dionyziz Fire Flower by dionyziz
Hi. Here's a piece of equation art that evolved after playing around with a piece of code Rhapsody and I wrote together.

Programming:
:icongeekfish: :icondionyziz:

Thanks for all the equation art inspiration:
:iconmccann:

Technical details:
This was rendered using PHP and the GD graphics library. The shape evolves from an intersection of circles and pedals drawn around a center point with various radio values each in constant distance from the next.

The flames are created by using a flood fill algorithm and restricting it in resolution to create areas that get filled. Anti aliasing is disabled in purpose to achieve these beautiful fillings by taking advantage of areas the get closer as we approach the center of the shape.

Pedals are drawn using the absolute value of the sinus function and using a circle at the same center as the rest as an x axis and the circle's perpendicular vector at each point as the y axis.

If you're a programmer, you can use PHP to render it yourself. Here's the code. Feel free to use it and modify it for any need. Feel free to leave a comment for any questions you may have, including mathematics or programming questions relevant to this piece. Constructive critique is also very welcome :)

<?php
/*
Copyright 2009 (c)
<rhapsody@kamibu.com>
<dionyziz@kamibu.com>
Licensed under the MIT license: [link]
*/

function line( $img, $x1, $y1, $x2, $y2, $color ) {
$tranz1 = transform( $x1, $y1 );
$tranz2 = transform( $x2, $y2 );

imageline( $img, $tranz1[ 'x' ], $tranz1[ 'y' ], $tranz2[ 'x' ], $tranz2[ 'y' ], $color );
}
function transform( $x, $y ) {
$transx = CENTERX + $x;
$transy = CENTERY - $y;

return array( 'x' => $transx, 'y' => $transy );
}
function sinabs( $theta ) {
return abs( sin( $theta ) );
}
function drawPedals( $img, $radio, $pedals, $color ) {
for ( $theta = -0.1; $theta <= 2 * pi(); $theta += 0.001 ) {
$transradio = $radio + sinabs( $theta * $pedals / 2 ) * 100;

$x = $transradio * cos( $theta );
$y = $transradio * sin( $theta );

if ( isset( $prevx ) ) {
line( $img, $x, $y, $prevx, $prevy, $color );
}
$prevx = $x;
$prevy = $y;
}
}
function flower() {
header( 'Content-type: image/png' );

define( 'WIDTH', 1024 );
define( 'HEIGHT', 1024 );
define( 'CENTERX', WIDTH / 2 );
define( 'CENTERY', HEIGHT / 2 );

$img = imagecreatetruecolor( WIDTH, HEIGHT );

$white = imagecolorallocate( $img, 255, 255, 255 );
$black = imagecolorallocate( $img, 0, 0, 0 );
$red = imagecolorallocate( $img, 255, 0, 0 );
$yellow = imagecolorallocate( $img, 255, 255, 0 );

imagefill( $img, 0, 0, $white );

$fadevar = 0;
$centerradio = 500;

for ( $r = $centerradio; $r; $r -= 5 ) {
drawPedals( $img, 300 - $r, 10, $black );
imagefill( $img, CENTERX + $centerradio + 1 , CENTERY + $centerradio + 1, $red );
}
for ( $r = $centerradio; $r; $r -= 5 ) {
$fadevar += 2;
$centercolor = imagecolorallocate( $img, 255, 255, $fadevar );
imagearc( $img, CENTERX, CENTERY, 2 * $r, 2 * $r, 0, 360, $centercolor );
imagefill( $img, CENTERX, CENTERY, $centercolor );
}

imageconvolution( $img, array( array( 1, 2, 1 ), array( 2, 4, 2 ), array( 1, 2, 1 ) ), 16, 0 );
imagepng( $img );
}
flower();
?>
Add a Comment:
 

The Artist has requested Critique on this Artwork

Please sign up or login to post a critique.

:iconsilverwolf90:
Silverwolf90 Featured By Owner Jan 17, 2010
A fire flower indeed. I would also say a sun one :3 Looks so pretty and gives me so much energy looking at it :heart:
Great job dear :**
Reply
:icondionyziz:
dionyziz Featured By Owner Apr 10, 2010
Thank you so much for your kind words! :)
Reply
:iconsilverwolf90:
Silverwolf90 Featured By Owner Apr 13, 2010
It's all my pleasure :)
Reply
:icondancewiththesky:
dancewiththesky Featured By Owner Jul 24, 2009
Neat, indeed. Do you know about Context Free?
Reply
:icondionyziz:
dionyziz Featured By Owner Jul 30, 2009
Checked it out now, quite cool actually :-)
Reply
:icongeekfish:
Geekfish Featured By Owner Jul 23, 2009
woah, neat :bounce:
Reply
Add a Comment: