変数の定義let x;
let x;
複素数の定義 z=2+3ilet z = new Complex(2.0,3.0);
let z = new Complex(2.0,3.0);
和 z=z1+z2let z = z1.add(z2)
let z = z1.add(z2)
差 z=z1−z2let z = z1.sub(z2)
let z = z1.sub(z2)
積 z=z1z2let z = z1.mul(z2)
let z = z1.mul(z2)
商 z=z1/z2let z = z1.div(z2)
let z = z1.div(z2)
複素指数関数 w=ezlet w = z.exp()
let w = z.exp()
複素対数関数 w=ln(z)=ln|z|+iarg(z)let w = z.log();
let w = z.log();
複素共役 w=z∗=Re(z)−iIm(z)let w = z.conjugate();
let w = z.conjugate();
絶対値 (返り値は実数) r=|z|let r = z.abs();
let r = z.abs();
偏角 (返り値は実数) θ=arg(z),−π≤θ<πlet t = z.arg()
let t = z.arg()
正弦関数の使用例 z=sin(t)let z = new Complex(Math.sin(t),0.0);
let z = new Complex(Math.sin(t),0.0);
余弦関数の使用例 z=icos(t)let z = new Complex(0.0,Math.cos(t));
let z = new Complex(0.0,Math.cos(t));
床関数の使用例 z=floor(t)let z = new Complex(Math.floor(t), 0.0);
let z = new Complex(Math.floor(t), 0.0);
乱数の使用例 z=rand(x)let z = new Complex(Math.rand(t), 0.0);
let z = new Complex(Math.rand(t), 0.0);