PHP code example of alemian95 / php-complex-numbers
1. Go to this page and download the library: Download alemian95/php-complex-numbers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
alemian95 / php-complex-numbers example snippets
use Alemian95\PhpComplexNumbers\Complex;
// Create a complex number using Cartesian coordinates
$complex1 = new Complex(3.0, 4.0);
// Create a complex number using polar coordinates
$complex2 = Complex::createFromPolar(5.0, 0.92729521800161); // Equivalent to (3, 4)