public function length2() : float {
        $value = 0;
        $count = count($this->elements);
        for ($i=0;$i<$count;$i++) {
            $value += ($this[$i] * $this[$i]);
        }
        return $value;
    }