-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbasic.php
52 lines (39 loc) · 1.09 KB
/
basic.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
48
49
50
51
52
<?php
/*
* This file is part of php-drawille
*
* (c) Jeff Welch <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once __DIR__ . '/vendor/autoload.php';
use Drawille\Canvas;
$canvas = new Canvas();
for ($x = 0; $x <= 1800; $x++) {
$canvas->set($x / 10, sin($x * M_PI / 180) * 10);
}
echo $canvas->frame(), "\n";
$canvas->clear();
for ($x = 0; $x <= 1800; $x += 10) {
$canvas->set($x / 10, 10 + sin($x * M_PI / 180) * 10);
$canvas->set($x / 10, 10 + cos($x * M_PI / 180) * 10);
}
echo $canvas->frame(), "\n";
$canvas->clear();
for ($x = 0; $x <= 3600; $x += 20) {
$canvas->set($x / 20, 4 + sin($x * M_PI / 180) * 4);
}
echo $canvas->frame(), "\n";
$canvas->clear();
for ($x = 0; $x <= 360; $x += 4) {
$canvas->set($x / 4, 30 + sin($x * M_PI / 180) * 30);
}
for ($x = 0; $x <= 30; $x++) {
for ($y = 0; $y <= 30; $y++) {
$canvas->set($x, $y);
$canvas->toggle($x+30, $y+30);
$canvas->toggle($x+60, $y);
}
}
echo $canvas->frame(), "\n";