-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmandelbrot_ascii.php
47 lines (41 loc) · 1.09 KB
/
mandelbrot_ascii.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang=en>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<style>
body { color: #ffffff; background-color: #000000; font-size: 8pt; font-family: "Courier New"; margin-top: 100px; text-align: center; }
</style>
</head>
<body>
<?php
$size = 20;
$field = 2;
$max = 10;
for($i=-$size;$i<$size-13;$i++){
for($j=-$size;$j<$size;$j++){
$a = $i/$size*$field;
$b = $j/$size*$field;
$asave = $a;
$bsave = $b;
$count = 0;
while (($a*$a+$b*$b<4)&&($count<$max)){
$temp = $a*$a - $b*$b + $asave;
$b = 2*$a*$b + $bsave;
$a = $temp;
$count++;
}
if ($count == $max){
print "o";
}else{
print " ";
}
}
print "<br>";
}
print "<br><br><br><br>";
print "1.11.2005<br>";
print "The Mandelbrot set generated by PHP<br>";
print "Dany Shaanan";
?>
</body>
</html>