complex
Generated by tinox doc
tinox.core.complex, bundled with the compiler and also available as a standalone tinox-central package.
Arithmetic
import tinox.core.complex
class Main
{
fnc main() -> Int32
{
const a: Complex = Complex::new(3.0, 4.0)
const b: Complex = Complex::new(1.0, 2.0)
const sum: Complex = Complex::add(a, b)
println(Complex::toString(sum))
const mag: Float64 = Complex::magnitude(a)
println("magnitude of a: " + mag.toString())
return 0
}
}
class Complex
Fields
real | Float64 | |
imag | Float64 |
Methods
fn new(real: Float64, imag: Float64) → Complex
fn fromPolar(r: Float64, theta: Float64) → Complex
fn add(a: Complex, b: Complex) → Complex
fn subtract(a: Complex, b: Complex) → Complex
fn multiply(a: Complex, b: Complex) → Complex
fn divide(a: Complex, b: Complex) → Complex
fn magnitude(c: Complex) → Float64
fn phase(c: Complex) → Float64
fn conjugate(c: Complex) → Complex
fn reciprocal(c: Complex) → Complex
fn toString(c: Complex) → String
fn exp(c: Complex) → Complex
fn log(c: Complex) → Complex
fn pow(c: Complex, n: Float64) → Complex