def test_exponentialComplex(self):
     c1 = ComplexNumber(3, 4)
     c2 = c1.exponentialComplex()
     self.assertAlmostEqual(c2.getRealPart(), -13, 0)
     self.assertAlmostEqual(c2.getImagPart(), -15, 0)
     c2 = ComplexNumber(1, 0)
     c2 = c2.exponentialComplex()
     self.assertAlmostEqual(c2.getRealPart(), 2.7, 0)
     self.assertAlmostEqual(c2.getImagPart(), 0, 0)
Esempio n. 2
0
'''
Created on 27 Nov 2017

@author: tothi
'''
from Domain.Repo import ComplexRepository
from Controller.ComplexNumberController import ComplexNumberController
from UI.Menu import ComplexNumberMenu
from Domain.ComplexNumber import ComplexNumber


def start():
    repo = ComplexRepository()
    ctrl = ComplexNumberController(repo)
    ui = ComplexNumberMenu(ctrl)
    ui.menu()


#start()
c = ComplexNumber(5, 2)
print(c.exponentialComplex())