<?php

error_reporting(-1);
mb_internal_encoding("utf-8");

$phrase="АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЭЮЯ";
$phrase="А КАКОЙ ЖЕ ТЫ МУДАК!!!";
$phraseLength=mb_strlen($phrase);

$fromAngle=-80;
$toAngle=260;
$radius=12.5;

$height=30;
$centerX=40;
$centerY=15;

$screen=array();
for($y=0;$y<$height;$y++){
	$screen[$y]=array_fill(0,80,' ');
}

$step=360/$phraseLength;
for ($i=0; $i<$phraseLength; $i++){
	

	$alpha=deg2rad(($i*$step));
	$sina=rad2deg(sin($alpha));
	$cosa=rad2deg(cos($alpha));

	$x=round($radius*$sina/21);
	$y=round($radius*$cosa/49.5);

	$screen[-$y+$centerY][$x+$centerX]=mb_substr($phrase,$i,1);
}


for($y=0;$y<$height;$y++){
	for($x=0;$x<80;$x++){
		echo $screen[$y][$x];
	}
	echo "\n";
}

