Module: BigMathR::ComplexPlane
- Defined in:
- ext/bigdecimal/math_r/nucomp.c,
ext/bigdecimal/math_r/math_r.c
Overview
A module that provides whole of functions related to the complex plane. It is used internally.
Synopsis
The function names defined are the same as those in the C/C++ standard.
-
Complex argument:
:carg -
Complex absolute:
:cabs
Follow, the name defined in C/C++ standard though, the function names are different.
-
Quadrant XY:
:quadrant(:atan2in C/C++ )
Class Method Summary collapse
-
.cabs(z, prec) ⇒ BigDecimal
Return complex absolute of
z. -
.carg(z, prec) ⇒ BigDecimal
Return complex argument of
z. -
.l2norm(*args, prec) ⇒ BigDecimal
Return solve of the euclidean norm (L2-norm) for argument as numerical sequence.
-
.quadrant(x, y, prec) ⇒ BigDecimal, Complex
Consider where the value is in quadrant XY and computes the inverse tangent of
y/x.
Class Method Details
.cabs(z, prec) ⇒ BigDecimal
Return complex absolute of z.
72 73 74 75 76 77 |
# File 'ext/bigdecimal/math_r/nucomp.c', line 72 static VALUE __impl_nucomp_cabs(VALUE unused_obj, VALUE z, VALUE prec) { z = rb_num_canonicalize(z, prec, ARG_COMPLEX, ARG_RAWVALUE); return rb_bigmath_cabs(z, prec); } |
.carg(z, prec) ⇒ BigDecimal
Return complex argument of z.
125 126 127 128 129 130 |
# File 'ext/bigdecimal/math_r/nucomp.c', line 125 static VALUE __impl_nucomp_carg(VALUE unused_obj, VALUE z, VALUE prec) { z = rb_num_canonicalize(z, prec, ARG_COMPLEX, ARG_RAWVALUE); return rb_bigmath_carg(z, prec); } |
.l2norm(*args, prec) ⇒ BigDecimal
26 27 28 29 30 31 32 33 34 35 36 |
# File 'ext/bigdecimal/math_r/nucomp.c', line 26 static VALUE __impl_nucomp_l2norm(VALUE unused_obj, VALUE args) { if (RARRAY_LEN(args) < 2) rb_raise(rb_eArgError, "wrong number of arguments (given %ld, expected 2..)", RARRAY_LEN(args)); VALUE prec = rb_ary_pop(args); rb_check_precise(prec); return rb_bigmath_l2norm(args, prec); } |
.quadrant(x, y, prec) ⇒ BigDecimal, Complex
Consider where the value is in quadrant XY and computes the inverse tangent of y/x.
91 92 93 94 95 |
# File 'ext/bigdecimal/math_r/nucomp.c', line 91 static VALUE __impl_nucomp_quadrant(VALUE unused_obj, VALUE x, VALUE y, VALUE prec) { return rb_bigmath_quadrant(x, y, prec); } |