function getObj($obj) { $sumR = $this->r + $obj->r; $d = $obj->getArc($arc); if ($sumR >= $d) { self::$log = "Получен ответ на вопрос, пересекаются ли окружности? Ответ <b>Да</b>"; return true; } else { self::$log = "Получен ответ на вопрос, пересекаются ли окружности? Ответ <b>Нет</b>"; return false; } }
/** * Draws this object onto an image * * @param img.Image image * @return var */ public function draw($image) { $this->col = $this->colors[1]; $cy = $this->cy; for ($i = 1; $i < $this->shadow; $i++) { $this->cy = $cy + $i; parent::draw($image); } $this->cy = $cy; $this->col = $this->colors[0]; parent::draw($image); }
function __call($name, $args) { $string = print_r($args, true); self::$log = "Метода {$name} со значением {$string} не существует!"; }
<?php require_once getenv("DOCUMENT_ROOT") . "/lib/config.php"; require_once "Shape.php"; require_once "Arc.php"; require_once "Rectangle.php"; $arc = new Arc(10); echo $arc->calcS() . "<br/>"; echo $arc->calcP() . "<br/>"; $rect = new Rectangle(8, 6); echo $rect->calcS() . "<br/>"; echo $rect->calcP() . "<br/>";
{ return $this->prevArc->id; } public static function getRootArcs() { $options = array('where' => 'parent_arc_id is null or parent_arc_id=0'); $arc = new static(); return $arc->loadMultiple($options); } public function getPageNodes() { if (is_null($this->_pageNodes)) { $options = array('where' => 'arc_id = ? and is_active=1', 'orderBy' => 'page_number ASC', 'data' => array($this->id)); $node = new \ATPComic\Model\Node(); $this->_pageNodes = $node->loadMultiple($options); } return $this->_pageNodes; } public function getSubArcs($filterEmpty = true) { $arcs = (array) $this->getAtpcomicArcsByParentArc(); usort($arcs, function ($a, $b) { return $a->sortOrder - $b->sortOrder; }); return $filterEmpty ? array_filter($arcs, function ($arc) { return count($arc->getPageNodes()) > 0; }) : $arcs; } } Arc::init();
<?php require_once getenv("DOCUMENT_ROOT") . "/lib/config.php"; require_once "ArcColor.php"; $arc = new Arc(); $arc->setX(9); $arc->setY(15); $arc->setR(12); $arc2 = new Arc(6, 5, 8); echo $arc->getArc($arc2) . "<br/>"; echo $arc->getObj($arc2) . "<br/>"; echo "Получаем X = " . $arc->getX($x) . "<br/>"; echo "Получаем Y = " . $arc->getY($x) . "<br/>"; echo "Получаем R= " . $arc->getR($x) . "<br/>"; $arcColor = new ArcColor(5, 4, 8, "red"); $arcColor->setColor("Blue"); echo $arcColor->getColor() . "<br/>"; $arcColor->setY(10); echo $arcColor->getY() . "<br/>";
<?php require_once getenv("DOCUMENT_ROOT") . "/lib/config.php"; require_once "Arc.php"; $arc = new Arc(4, 5, -8); $arc->setR(-5);
public function __construct($x = 0, $y = 0, $r = 0) { $this->x = $x; $this->y = $y; $this->r = $r; } public function getObject($arc) { $rez = round(sqrt(($this->x - $arc->x) * ($this->x - $arc->x) + ($this->y - $arc->y) * ($this->y - $arc->y))); return $rez; } public function getType($ar) { $sumR = $this->r + $ar->r; $d = $ar->getObject($arc); if ($sumR >= $d) { return true; } else { return false; } } public function __destruct() { echo "Окружность с координатами ({$this->x} и {$this->y}) и радиусом {$this->r} уничтожена!<br/>"; } } $arc = new Arc(10, 15, 8); $arc2 = new Arc(4, 8, 5); echo $arc->getObject($arc2) . "<br/>"; echo $arc->getType($arc2) . "<br/>"; unset($arc);
<?php require_once getenv("DOCUMENT_ROOT") . "/lib/config.php"; require_once "Arc.php"; $arc = new Arc(); $arc_2 = clone $arc; $arc->getLog();
<?php require_once getenv("DOCUMENT_ROOT") . "/lib/config.php"; require_once "Arc.php"; $arc = new Arc(); $arc->z; $arc->getLog(); $arc->v = 56; $arc->getLog(); $arc->NotMethod(18, "stroka"); $arc->getLog();
<?php require_once getenv("DOCUMENT_ROOT") . "/lib/config.php"; require_once "Arc.php"; $arc = new Arc(5, 8, 7); $arc->getLog(); $arc_2 = new Arc(10, 12, 9); $arc->getLog(); $arc->getArc($arc_2); $arc->getLog(); $arc->getObj($arc_2); $arc->getLog();