You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
901 B
30 lines
901 B
2 months ago
|
<?php
|
||
|
|
||
|
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||
|
|
||
|
require __DIR__ . '/../../Header.php';
|
||
|
|
||
|
$category = 'Engineering';
|
||
|
$functionName = 'BESSELI';
|
||
|
$description = 'Returns the modified Bessel function, which is equivalent to the Bessel function evaluated for purely imaginary arguments';
|
||
|
|
||
|
$helper->titles($category, $functionName, $description);
|
||
|
|
||
|
// Create new PhpSpreadsheet object
|
||
|
$spreadsheet = new Spreadsheet();
|
||
|
$worksheet = $spreadsheet->getActiveSheet();
|
||
|
|
||
|
for ($n = 0; $n <= 5; ++$n) {
|
||
|
for ($x = 0; $x <= 5; $x = $x + 0.25) {
|
||
|
Calculation::getInstance($spreadsheet)->flushInstance();
|
||
|
$worksheet->setCellValue('A1', "=BESSELI({$x}, {$n})");
|
||
|
|
||
|
$helper->log(sprintf(
|
||
|
'%s = %f',
|
||
|
$worksheet->getCell('A1')->getValue(),
|
||
|
$worksheet->getCell('A1')->getCalculatedValue()
|
||
|
));
|
||
|
}
|
||
|
}
|