1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fix complex_test.v

This commit is contained in:
Alexander Medvednikov 2019-10-12 22:39:18 +03:00
parent 208f17a73a
commit 432e074b4e

View File

@ -125,15 +125,15 @@ fn test_complex_angle(){
// Test is based on and verified from practice examples of Khan Academy
// https://www.khanacademy.org/math/precalculus/imaginary-and-complex-numbers
mut c := cmplx.complex(1, 0)
assert (c.angle() * 180 / math.Pi).eq(0)
assert (c.angle() * 180 / math.pi).eq(0)
c = cmplx.complex(1, 1)
assert (c.angle() * 180 / math.Pi).eq(45)
assert (c.angle() * 180 / math.pi).eq(45)
c = cmplx.complex(0, 1)
assert (c.angle() * 180 / math.Pi).eq(90)
assert (c.angle() * 180 / math.pi).eq(90)
c = cmplx.complex(-1, 1)
assert (c.angle() * 180 / math.Pi).eq(135)
assert (c.angle() * 180 / math.pi).eq(135)
c = cmplx.complex(-1, -1)
assert (c.angle() * 180 / math.Pi).eq(-135)
assert (c.angle() * 180 / math.pi).eq(-135)
mut cc := c.conjugate()
assert (cc.angle() + c.angle()).eq(0)
}