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

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

{@inheritDoc}
public setFrom ( League\Geotools\Coordinate\CoordinateInterface $from )
$from League\Geotools\Coordinate\CoordinateInterface
    public function setFrom(CoordinateInterface $from)
    {
        $this->from = $from;
        if (empty($this->to) ||  ($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;
    }