Overview

Namespaces

  • chippyash
    • Type
      • Exceptions
      • Interfaces
      • Number
        • Complex
        • Rational
      • String

Interfaces

  • ComplexTypeInterface
  • GMPInterface
  • NumericTypeInterface
  • RationalTypeInterface
  • TypeInterface
  • Overview
  • Namespace
  • Class
  • Tree

Interface ComplexTypeInterface

Interface for chippyash\Type\Number\Complex\ComplexType types Makes it broadly compatible with other types

chippyash\Type\Interfaces\ComplexTypeInterface implements chippyash\Type\Interfaces\TypeInterface

Direct known implementers

chippyash\Type\Number\Complex\AbstractComplexType

Indirect known implementers

chippyash\Type\Number\Complex\ComplexType, chippyash\Type\Number\Complex\GMPComplexType
Namespace: chippyash\Type\Interfaces
Located at Interfaces/ComplexTypeInterface.php
Methods summary
public chippyash\Type\Number\Rational\RationalType
# r( )

Get the real part

Get the real part

Returns

chippyash\Type\Number\Rational\RationalType
RationalType
public chippyash\Type\Number\Rational\RationalType
# i( )

Get the imaginary part

Get the imaginary part

Returns

chippyash\Type\Number\Rational\RationalType
RationalType
public boolean
# isZero( )

Is this number equal to zero?

Is this number equal to zero?

Returns

boolean
boolean
public boolean
# isReal( )

Is this number a real number? i.e. is it in form n+0i

Is this number a real number? i.e. is it in form n+0i

Returns

boolean
boolean
public boolean
# isGaussian( )

Is this number Gaussian, i.e r & i are both equivelent to integers

Is this number Gaussian, i.e r & i are both equivelent to integers

Returns

boolean
boolean

Link

http://en.wikipedia.org/wiki/Gaussian_integer
public chippyash\Type\Number\Complex\ComplexType
# conjugate( )

Return conjugate of this number

Return conjugate of this number

Returns

chippyash\Type\Number\Complex\ComplexType
\chippyash\Type\Number\Complex\ComplexType
public chippyash\Type\Number\Rational\RationalType
# modulus( )

Return the modulus, also known as absolute value or magnitude of this number = sqrt(r2 + i2);

Return the modulus, also known as absolute value or magnitude of this number = sqrt(r2 + i2);

Returns

chippyash\Type\Number\Rational\RationalType
\chippyash\Type\Number\Rational\RationalType
public chippyash\Type\Number\Rational\RationalType
# theta( )

Return the angle (sometimes known as the argument) of the number when expressed in polar notation

Return the angle (sometimes known as the argument) of the number when expressed in polar notation

The return value is a rational expressing theta as radians

Returns

chippyash\Type\Number\Rational\RationalType
\chippyash\Type\Number\Rational\RationalType
public chippyash\Type\Number\Rational\RationalType
# radius( )

Return the radius (sometimes known as Rho) of the number when expressed in polar notation

Return the radius (sometimes known as Rho) of the number when expressed in polar notation

Returns

chippyash\Type\Number\Rational\RationalType
\chippyash\Type\Number\Rational\RationalType
public array[radius
# asPolar( )

Returns complex number expressed in polar form

Returns complex number expressed in polar form

radius == this->modulus() theta is angle expressed in radians

Returns

array[radius
=> RationalType, theta => RationalType]
public integer
# polarQuadrant( )

Returns the polar quadrant for the complex number Returns 1, 2, 3 or 4 dependent on the quadrant

Returns the polar quadrant for the complex number Returns 1, 2, 3 or 4 dependent on the quadrant

Returns

integer
int
public string
# polarString( )

Return complex number expressed as a string in polar form i.e. r(cosθ + i⋅sinθ)

Return complex number expressed as a string in polar form i.e. r(cosθ + i⋅sinθ)

Returns

string
string
Methods inherited from chippyash\Type\Interfaces\TypeInterface
__invoke(), __toString(), get(), set()
Chippyash Strong Types API documentation generated by ApiGen 2.8.0