protected static function dot4D($g, $x, $y, $z, $w) { return $g[0] * $x + $g[1] * $y + $g[2] * $z + $g[3] * $w; }