Methods summary
abstract 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
Implementation of
|
abstract 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
Implementation of
|
abstract public
chippyash\Type\Number\Complex\ComplexType
|
#
asComplex( )
Return the number as a Complex number i.e. n+0i
Return the number as a Complex number i.e. n+0i
Returns
Implementation of
|
abstract public
chippyash\Type\Number\Rational\RationalType
|
#
asRational( )
Return number as Rational number. NB, numerator and denominator will be caste
as IntTypes
Return number as Rational number. NB, numerator and denominator will be caste
as IntTypes
Returns
Throws
Implementation of
|
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
Implementation of
|
public
chippyash\Type\Number\IntType
|
#
asIntType( )
Return number as an IntType number. If number isReal() will return
floor(r())
Return number as an IntType number. If number isReal() will return
floor(r())
Returns
Throws
Implementation of
|
public
chippyash\Type\Number\FloatType
|
#
asFloatType( )
Return number as a FloatType number.
Return number as a FloatType number.
Returns
Throws
Implementation of
|
public
float
|
#
toFloat( )
If this complex number isReal() then return float equivalent else throw an
excepton
If this complex number isReal() then return float equivalent else throw an
excepton
Returns
float float
Throws
|
public
chippyash\Type\Number\Rational\AbstractRationalType
|
#
abs( )
Return the absolute value of the number
Return the absolute value of the number
Returns
Implementation of
|
public
chippyash\Type\Number\Complex\ComplexType
|
#
negate( )
Negates the number
Returns
Implementation of
|
public
chippyash\Type\Number\Rational\RationalType
|
#
r( )
Get the real part
Returns
Implementation of
|
public
chippyash\Type\Number\Rational\RationalType
|
#
i( )
Get the imaginary part
Returns
Implementation of
|
public
boolean
|
#
isZero( )
Is this number equal to zero?
Is this number equal to zero?
Returns
boolean boolean
Implementation of
|
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
Implementation of
|
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
Implementation of
|
public
chippyash\Type\Number\Complex\ComplexType
|
#
conjugate( )
Return conjugate of this number
Return conjugate of this number
Returns
Implementation of
|
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
Implementation of
|
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]
Implementation of
|
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
Implementation of
|
public
string
|
#
__toString( )
String representation of complex number If isReal() then string
representation of the real part else r(+/-)ii
String representation of complex number If isReal() then string
representation of the real part else r(+/-)ii
Returns
string string
Overrides
Implementation of
|
public
|
#
__clone( )
Magic clone method Ensure value gets cloned when object is cloned
Magic clone method Ensure value gets cloned when object is cloned
Overrides
|
public
string
|
#
__invoke( )
Proxy to get()
Returns
string string
Overrides
Implementation of
|