This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'complex.php'; | |
#Examples | |
$complex = new Complex(); //instance | |
$complex->set_comp_num(3,4); //define number(Default 0,0) | |
echo"Number: ".$complex->comp_numb."<br>"; | |
echo"Real: ".$complex->real."<br>"; | |
echo"Imaginer: ".$complex->imaginer."<br>"; | |
echo "Modulus: ".$complex->modulus()."<br>"; | |
echo "Polar Form: ".$complex->polar_form()."<br>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#Coded By Yakup Yavaş | |
#Complex Number PHP Class | |
class Complex { | |
public $real; | |
public $imaginer; | |
public $comp_numb; | |
public $degree; | |
function __construct() //constructor method | |
{ |