Fix theta #452

Merged
CommanderTvis merged 1 commits from commandertvis/theta into dev 2022-02-02 10:00:29 +03:00

View File

@ -41,7 +41,7 @@ public val Complex.r: Double
* An angle between vector represented by complex number and X axis. * An angle between vector represented by complex number and X axis.
*/ */
public val Complex.theta: Double public val Complex.theta: Double
get() = atan(im / re) get() = atan2(im, re)
private val PI_DIV_2 = Complex(PI / 2, 0) private val PI_DIV_2 = Complex(PI / 2, 0)