php 情书,PHP好玩的代码一(笛卡尔的情书)
生活随笔
收集整理的這篇文章主要介紹了
php 情书,PHP好玩的代码一(笛卡尔的情书)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
效果:
代碼:
$width = 600; $height = 650; header("Content-type: image/gif"); $img = imagecreate($width, $height); $bg_color = imagecolorallocate($img, 0, 0, 0); $red = imagecolorallocate($img, 255, 0, 0); for ($i = 0; $i <= 100; $i++) { ??? for ($j = 0; $j <= 100; $j++) { ??????? $r = M_PI / 50 * $i * (1 - sin(M_PI / 50 * $j)) * 40; ??????? $x = $r * cos(M_PI / 50 * $j) * sin(M_PI / 50 * $i) + $width / 2; ??????? $y = -$r * sin(M_PI / 50 * $j) + $height / 6; ??????? imagesetpixel($img, $x, $y, $red); ??? } } imagegif($img); imagedestroy($img);exit;
總結(jié)
以上是生活随笔為你收集整理的php 情书,PHP好玩的代码一(笛卡尔的情书)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: centos 6.5配置php,Cent
- 下一篇: php大号字体代码,支持中文字母数字、自