30 $returnValue += ($arg1 * $arg1);
33 return $e->getMessage();
39 private static function getCount(array $array1, array $array2): int
41 $count = count($array1);
42 if ($count !== count($array2)) {
56 return is_numeric($item) && !is_string($item);
72 $count = self::getCount($array1, $array2);
75 for (
$i = 0;
$i < $count; ++
$i) {
76 if (self::numericNotString($array1[
$i]) && self::numericNotString($array2[$i])) {
77 $result += ($array1[
$i] * $array1[
$i]) - ($array2[$i] * $array2[$i]);
81 return $e->getMessage();
100 $count = self::getCount($array1, $array2);
103 for (
$i = 0;
$i < $count; ++
$i) {
104 if (self::numericNotString($array1[
$i]) && self::numericNotString($array2[$i])) {
105 $result += ($array1[
$i] * $array1[
$i]) + ($array2[$i] * $array2[$i]);
109 return $e->getMessage();
128 $count = self::getCount($array1, $array2);
131 for (
$i = 0;
$i < $count; ++
$i) {
132 if (self::numericNotString($array1[
$i]) && self::numericNotString($array2[$i])) {
133 $result += ($array1[
$i] - $array2[
$i]) * ($array1[$i] - $array2[$i]);
137 return $e->getMessage();
static validateNumericNullSubstitution($number, $substitute)
Validate numeric, but allow substitute for null.
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
static sumXSquaredPlusYSquared($matrixData1, $matrixData2)
SUMX2PY2.
static sumXSquaredMinusYSquared($matrixData1, $matrixData2)
SUMX2MY2.
static getCount(array $array1, array $array2)
static numericNotString($item)
These functions accept only numeric arguments, not even strings which are numeric.
static sumSquare(... $args)
SUMSQ.
static sumXMinusYSquared($matrixData1, $matrixData2)
SUMXMY2.