Next: , Previous: Conversion, Up: Numbers Complex Number Operations

— Scheme Procedure: make-rectangular real imaginary
— C Function: scm_make_rectangular (real, imaginary)

Return a complex number constructed of the given real and imaginary parts.

— Scheme Procedure: make-polar x y
— C Function: scm_make_polar (x, y)

Return the complex number x * e^(i * y).

— Scheme Procedure: real-part z
— C Function: scm_real_part (z)

Return the real part of the number z.

— Scheme Procedure: imag-part z
— C Function: scm_imag_part (z)

Return the imaginary part of the number z.

— Scheme Procedure: magnitude z
— C Function: scm_magnitude (z)

Return the magnitude of the number z. This is the same as abs for real arguments, but also allows complex numbers.

— Scheme Procedure: angle z
— C Function: scm_angle (z)

Return the angle of the complex number z.

— C Function: SCM scm_c_make_rectangular (double re, double im)
— C Function: SCM scm_c_make_polar (double x, double y)

Like scm_make_rectangular or scm_make_polar, respectively, but these functions take doubles as their arguments.

— C Function: double scm_c_real_part (z)
— C Function: double scm_c_imag_part (z)

Returns the real or imaginary part of z as a double.

— C Function: double scm_c_magnitude (z)
— C Function: double scm_c_angle (z)

Returns the magnitude or angle of z as a double.