Skip to content

taketo1024/SwiftComplex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftComplex

screenshot

Interact with Complex Numbers! This is a simple project which you can visually understand how complex multiplication works.

Complex

let z =  3 + 2 * i
let w = -2 - i
z + w ==  1 + i
z * w == -4 - 7 * i

Also supports polar form.

let z = Complex(r: 2, θ: M_PI / 4)
abs(z) == 2
arg(z) == M_PI / 4

Check out the code and see how simple they are implemented!

ComplexPlane

complex-plane

let cplane = ComplexPlane(frame: …)
cplane["1"] = Complex(1)
cplane["i"] = i

let z = Complex(r: 2, θ: M_PI / 3)
cplane["z"] = z
cplane.colors["z"] = UIColor.redColor()

let w = z * z
cplane["w"] = w
cplane.colors["w"] = UIColor.blueColor()

Here's the code.

Copyright and license

copyright 2014 Taketo Sano. Code released under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages