Toggle navigation
Hot Examples
EN
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Search
Home
Eris
Quantifier
Size
triangleNumber
Eris\Quantifier\Size::triangleNumber PHP Method
Size Class Documentation
Show file
Open project: giorgiosironi/eris
triangleNumber()
private
static
method
Returns the number of dots needed to compose a triangle with n dots on a side. E.G.: when n=3 the function evaluates to 6 . . . . . .
private
static
triangleNumber
(
$n
)
private static function triangleNumber($n) { if ($n === 0) { return 0; } return $n * ($n + 1) / 2; }
Size
__construct
at
count
generateList
limit
linearGrowth
max
triangleNumber
withLinearGrowth
withTriangleGrowth