A⋅B
projᵇA = --- B
|B|²

@param self $other
@return self
@link https://en.wikipedia.org/wiki/Vector_projection#Vector_projection
966446
public function projection(self $other): self
    {
        return self::fromMatrix($other->multiplyScalar($this->dotProduct($other) / ($other->l2norm() ** 2)));
    }
516001
public function intersection(Interval $other)
	{
		if ($this->isContaining($other)) {
			return $other;

		} elseif ($other->isContaining($this)) {
			return $this;

		} elseif ($this->isOverlappedFromRightBy($other)) {
			// This:  □□□□□□■■■■■■■■■■■□□□□□□□□□□□□□□□□□□□□
			// Other: □□□□□□□□□□□□■■■■■■■■■■■□□□□□□□□□□□□□□
			//    $other->from   |   | <- $this-till

			return new static($other->getLeft(), $this->getRight());

		} elseif ($other->isOverlappedFromRightBy($this)) {
			// This:  □□□□□□□□□□□□■■■■■■■■■■■□□□□□□□□□□□□□□□□□
			// Other: □□□□□□■■■■■■■■■■■□□□□□□□□□□□□□□□□□□□□□□□
			//    $this->from -> |   | <- $other-till

			return new static($this->getLeft(), $other->getRight());
		}

		$dummy = $this->left->asOpened();

		return new static($dummy, $dummy);
	}
175654
public function lessThanOrEqual($other)
    {
        $this->doCheck(function ($value) use ($other) {
            $this->throwExceptionIfFalse(
                $value <= $other,
                'Failed assertion that %s is less than %s', $value, $other
            );
        });

        return $this;
    }
763426
public function merge(self $other)
    {
        $new      = clone $this;
        $newWhere = $new->select->where;
        
        foreach ($other->select->where->getPredicates() as $pData) {
            $newWhere->addPredicate($pData[1], $pData[0]);
        }
        
        return $new;
    }
814139
public function remainder($other, array $options = []): Image
    {
        if (self::isImageish($other)) {
            return self::call('remainder', $this, [$other], $options);
        } else {
            return self::call('remainder_const', $this, [$other], $options);
        }
    }
100162
public function project(Vector $b) : self
    {
        $bHat = $this->dot($b) / ($b->l2Norm() ** 2);

        return $b->multiply($bHat);
    }
392132
public static function lessThanOrEqual(Expr $left, Expr $right) : BinOp
    {
        return new BinOp($left, BinOp::LESS_THAN_OR_EQUAL, $right);
    }
341253
public function lessThan( $other )
	{
		return $this->namespaceURI == null && $other->namespaceURI ||
		$this->namespaceURI && $other->namespaceURI && $this->namespaceURI < $other->namespaceURI ||
		$this->namespaceURI == $other->namespaceURI && $this->localName < $other->localName;
	}
1140640
public function moreEq($other, array $options = []): Image
    {
        return $this->callEnum($other, 'relational', OperationRelational::MOREEQ, $options);
    }
411390
public function gt($other)
    {
        if (!($other instanceof self)) {
            $other = new BigInt($other);
        }
        return ($this->compare($other) > 0);
    }
179954
public function equals( $other )
	{
		try
		{
			return $this->qnameValueHash == $other->qnameValueHash ||
				( $this->localName == $other->localName && $this->namespaceURI == $other->namespaceURI );
		}
		catch( \Exception $ex )
		{
			return false;
		}
	}
408455
function equals( $other ) {
		if( ! ( $other instanceof Address ) ) {
			return false;
		}
		return $this === $other
			|| $this->asString() === $other->asString();
	}
601187
def +(other)
	    return self.clone unless other

	    case other
		when Array, Vector
		    if @translation
			Transformation.new(@translation+other, @rotation, @scale)
		    else
			Transformation.new(other, @rotation, @scale)
		    end
		when Composition
		    Composition.new(self, *other.transformations)
		when Transformation
		    if @rotation || other.rotation
			Composition.new(self, other)
		    else
			translation = @translation ? (@translation + other.translation) : other.translation
			Transformation.new(translation, @rotation, @scale)
		    end
	    end
	end
574067
public function outerProduct(Vector $other): Matrix
    {
        $literal = [];

        for ($i = 0; $i < $this->getSize(); $i++) {
            for ($j = 0; $j < $other->getSize(); $j++) {
                $literal[$i][$j] = $this->toArray()[$i] * $other->toArray()[$j];
            }
        }

        return new Matrix($literal);
    }
364768
protected function _add(Matrix $other, $sign = 1)
    {
        $a1 = $this->toArray();
        $a2 = $other->toArray();

        $newMatrix = [];
        for ($i = 0; $i < $this->rows; ++$i) {
            for ($k = 0; $k < $this->columns; ++$k) {
                $newMatrix[$i][$k] = $a1[$i][$k] + $sign * $a2[$i][$k];
            }
        }

        return new self($newMatrix, false);
    }
575091
public function compareTo($other)
    {
        if ($other === null) {
            return false;
        }
        if (!($other instanceof ExpressionNode)) {
            return false;
        }

        if ($this->getOperator() != $other->getOperator()) return false;

        $thisLeft = $this->getLeft();
        $otherLeft = $other->getLeft();
        $thisRight = $this->getRight();
        $otherRight = $other->getRight();

        if ($thisLeft === null) {
            return $otherLeft === null && $thisRight->compareTo($otherRight);
        }

        if ($thisRight === null) {
            return $otherRight=== null && $thisLeft->compareTo($otherLeft);
        }

        return $thisLeft->compareTo($otherLeft) && $thisRight->compareTo($otherRight);
    }
712366
public function intersection(Geometry $other): Geometry {
        $event = new ProcessOpEvent($this, ['other' => $other]);
        $this->fireOperationEvent(ProcessOpEvent::INTERSECTION_EVENT, $event);
        return $event->getResults();
    }