Quantcast
Channel: Сообщество PHP DevelStudio - среда разработки программ
Viewing all articles
Browse latest Browse all 6336

round - крутой баг DS :D

$
0
0
:a6: а я уже давно стал замечать что round в ds как-то криво работает
Достаточно простой пример
PHP код:

 $y round((float)0);
echo 
'Дальше код не выполниться'

Я проверил, на сайте все прекрасно работает. :a7: и как мне теперь круг рисовать)xD
Скрытый текст:

PHP код:

You can use SIN & COS to create/draw circles.

Please beware that the circle's center is also your base point (0,0). So without specifying an offset, some coordinates will be negative.

<?php

$circleRadius 
70;
$offsetX      100;
$offsetY      100;

for(
$i 0$i <= 360; ++$i) {
    
$x round(cos($i M_PI 180) * $circleRadius);
    
$y round(sin($i M_PI 180) * $circleRadius);           // уи) тут PHP зависнет
   
    // Draw some pixel, or do something else here.
    
imagesetpixel($GDimage$x $offsetX$y $offsetY$GDcolor);
}

?>


Viewing all articles
Browse latest Browse all 6336

Trending Articles