API Docs for: 0.99.4
Show:

JXG.Complex Class

Module: JXG

This class is for calculating with complex numbers. A class for complex arithmetics JXG.Complex is defined in this file. Also a namespace JXG.C is included to provide instance-independent arithmetic functions.

Constructor

JXG.Complex

(
  • [x=0]
  • [y=0]
)

Parameters:

  • [x=0] Number optional

    Real part.

  • [y=0] Number optional

    Imaginary part.

Item Index

Methods

add

(
  • c
)
JXG.Complex chainable

Add another complex number to this complex number.

Parameters:

  • c JXG.Complex | Number

    A JavaScript number or a JXG.Complex object to be added to the current object.

Returns:

JXG.Complex:

Reference to this complex number

conj

() JXG.Complex chainable

Conjugate a complex number in place.

Returns:

JXG.Complex:

Reference to this complex number

div

(
  • c
)
JXG.Complex chainable

Divide this complex number by the given complex number.

Parameters:

  • c JXG.Complex | Number

    A JavaScript number or a JXG.Complex object to divide the current object by.

Returns:

JXG.Complex:

Reference to this complex number

mult

(
  • c
)
JXG.Complex chainable

Multiply another complex number to this complex number.

Parameters:

  • c JXG.Complex | Number

    A JavaScript number or a JXG.Complex object to multiply with the current object.

Returns:

JXG.Complex:

Reference to this complex number

sub

(
  • c
)
JXG.Complex chainable

Subtract another complex number from this complex number.

Parameters:

  • c JXG.Complex | Number

    A JavaScript number or a JXG.Complex object to subtract from the current object.

Returns:

JXG.Complex:

Reference to this complex number

toString

() String

Converts a complex number into a string.

Returns:

String:

Formatted string containing the complex number in human readable form (algebraic form).

Properties

absval

Number

Absolute value in the polar form of the complex number. Currently unused.

angle

Number

Angle value in the polar form of the complex number. Currently unused.

imaginary

Number

Imaginary part of the complex number.

Default: 0

isComplex

Boolean private

This property is only to signalize that this object is of type JXG.Complex. Only used internally to distinguish between normal JavaScript numbers and JXG.Complex numbers.

Default: true

real

Number

Real part of the complex number.

Default: 0