complex
Generated by tinox doc
Complex number arithmetic (Float64 real/imag parts): add/subtract/multiply/divide, magnitude/phase, conjugate, reciprocal, exp/log/pow, and polar-coordinate construction.
| Module | Version | Group |
|---|---|---|
mathf | 1.0.0 | tinox.core |
Arithmetic
import tinox.core.complex;
class Main
{
fnc main() -> Int32
{
let a: Complex = Complex::new(3.0, 4.0);
let b: Complex = Complex::new(1.0, 2.0);
let sum: Complex = Complex::add(a, b);
println(Complex::toString(sum));
let 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