문제

How can you make a Koch Snowflake Fractal using php gd so that it comes out like this...


alt text

alt text


Is it possible? Is there another resource I can use?

도움이 되었습니까?

해결책

imageline, imagerotate, imagefill, and imagefilledpolygon are your friends. they're all in the php manual. as far as the math goes, you can add this to your references: http://www.fractaldesign.net/algor.htm

다른 팁

You can create an image and draw lines on it using imageline.

Another posibility is using SVG. Since SVG are basically XML documents, you can make an SVG image by simply echo'ing some XML.

echo '<line x1="'.$startx.'" y1="'.$starty.'" x2="300" y2="300" />';
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top