/** * @covers tarcisio\p2d\Line::isVertical */ public function testIsVertical() { $line = new Line(5, 1, 5, 15); $this->assertTrue($line->isVertical()); $line = new Line(5, 2, 10, 20); $this->assertFalse($line->isVertical()); }
/** * Center X values of the axis * * @param awAxis $axis An axis * @param float $value The reference value on the axis */ public function setXCenter(awAxis $axis, $value) { // Check vector angle if ($this->line->isVertical() === FALSE) { trigger_error("setXCenter() can only be used on vertical axes", E_USER_ERROR); } $p = $axis->getPointFromValue($value); $this->line->setX($p->x, $p->x); }
/** * Center X values of the axis * * @param awAxis $axis An axis * @param float $value The reference value on the axis */ public function setXCenter(awAxis $axis, $value) { // Check vector angle if ($this->line->isVertical() === FALSE) { awImage::drawError("Class Axis: setXCenter() can only be used on vertical axes."); } $p = $axis->getPointFromValue($value); $this->line->setX($p->x, $p->x); }