League\Geotools\Vertex\Vertex::setTo PHP Метод

setTo() публичный Метод

{@inheritDoc}
public setTo ( League\Geotools\Coordinate\CoordinateInterface $to )
$to League\Geotools\Coordinate\CoordinateInterface
    public function setTo(CoordinateInterface $to)
    {
        $this->to = $to;
        if (empty($this->from) || $this->to->getLatitude() - $this->from->getLatitude() === 0) {
            return $this;
        }
        $this->gradient = ($this->to->getLongitude() - $this->from->getLongitude()) / ($this->to->getLatitude() - $this->from->getLatitude());
        $this->ordinateIntercept = $this->from->getLongitude() - $this->from->getLatitude() * $this->gradient;
        return $this;
    }