Package coneforest.psylla.core
Class PsyComplex
java.lang.Object
coneforest.psylla.core.PsyComplex
- All Implemented Interfaces:
PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyAtomic
,PsyConvertableToName
,PsyConvertableToString
,PsyMultiplicative<PsyNumeric>
,PsyNumeric
,PsyObject
A representation of
complex
object.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PsyComplex
static final PsyComplex
static final PsyComplex
static final PsyComplex
static final PsyOperator[]
static final PsyComplex
static final PsyComplex
-
Constructor Summary
ConstructorsConstructorDescriptionPsyComplex
(double re) PsyComplex
(double re, double im) PsyComplex
(PsyRealNumeric oNumeric) PsyComplex
(PsyRealNumeric oRealPart, PsyRealNumeric oImagPart) -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the real part of this object.psyAbs()
Returns anumeric
absolute value of this object.psyAcos()
Returns anumeric
representing the arc cosine of this object.psyAdd
(PsyNumeric oNumeric) Returns anadditive
representing the result of arithmetic addition of given object to this object.psyArg()
Returns areal
representing the complex argument of this object.psyAsin()
Returns anumeric
representing the arc sine of this object.psyAtan()
Returns anumeric
representing the arc tangent of this object.psyCbrt()
Returns anumeric
representing the cubic root of this object.Returns acomplex
representing the complex conjugate of this object.psyCos()
Returns anumeric
representing the cosine of this object.psyCosh()
Returns anumeric
representing the hyperbolic cosine of this object.psyDiv
(PsyNumeric oNumeric) Returns a result of arithmetic division of this object by given object.psyExp()
Returns anumeric
representing the exponent of this object.static PsyComplex
psyFromPolar
(double abs, double arg) static PsyComplex
psyFromPolar
(PsyRealNumeric oAbs, PsyRealNumeric oArg) Returns areal
imaginary part of this object.Returns aboolean
indicating whether this object represents a zero value.psyLog()
Returns anumeric
representing the natural logarithm of this object.psyMul
(PsyNumeric oNumeric) Returns a result of arithmetic multiplication of given object by this object.psyNeg()
Returns anadditive
representing the result of arithmetic negation of this object.psyPow
(PsyNumeric oNumeric) Returns areal
real part of this object.psySin()
Returns anumeric
representing the sine of this object.psySinh()
Returns anumeric
representing the hyperbolic sine of this object.psySqrt()
Returns anumeric
representing the square root of this object.psySub
(PsyNumeric oNumeric) Returns anadditive
representing the result of arithmetic subtraction of given object from this object.psyTan()
Returns anumeric
representing the tangent of this object.psyTanh()
Returns anumeric
representing the hyperbolic tangent of this object.double
Returns the real part of this object.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface coneforest.psylla.core.PsyAdditive
psyNotZero
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
Field Details
-
ZERO
-
ONE
-
MINUS_ONE
-
TWO
-
I
-
MINUS_I
-
OPERATORS
-
-
Constructor Details
-
PsyComplex
public PsyComplex(double re, double im) -
PsyComplex
public PsyComplex(double re) -
PsyComplex
-
PsyComplex
-
-
Method Details
-
realValue
public double realValue()Description copied from interface:PsyNumeric
Returns the real part of this object.- Specified by:
realValue
in interfacePsyNumeric
- Returns:
- the real part.
-
imagValue
public double imagValue()Description copied from interface:PsyNumeric
Returns the real part of this object.- Specified by:
imagValue
in interfacePsyNumeric
- Returns:
- the imaginary part.
-
psyIsZero
Description copied from interface:PsyAdditive
Returns aboolean
indicating whether this object represents a zero value.- Specified by:
psyIsZero
in interfacePsyAdditive<PsyNumeric>
- Returns:
PsyBoolean.TRUE
if this object represents a zero value, andPsyBoolean.FALSE
otherwise.
-
psyAbs
Description copied from interface:PsyNumeric
Returns anumeric
absolute value of this object.- Specified by:
psyAbs
in interfacePsyNumeric
- Returns:
- a
numeric
absolute value.
-
toSyntaxString
- Specified by:
toSyntaxString
in interfacePsyObject
-
psyRealPart
Returns areal
real part of this object.- Returns:
- a
real
real part.
-
psyImagPart
Returns areal
imaginary part of this object.- Returns:
- a
real
imaginary part.
-
psyArg
Returns areal
representing the complex argument of this object. The argument belongs to the range (−π; π].- Returns:
- a
real
argument.
-
psyConjugate
Returns acomplex
representing the complex conjugate of this object.- Returns:
- a
complex
conjugate of this number.
-
psyNeg
Description copied from interface:PsyAdditive
Returns anadditive
representing the result of arithmetic negation of this object.- Specified by:
psyNeg
in interfacePsyAdditive<PsyNumeric>
- Returns:
- a negation.
-
psyAdd
Description copied from interface:PsyAdditive
Returns anadditive
representing the result of arithmetic addition of given object to this object.- Specified by:
psyAdd
in interfacePsyAdditive<PsyNumeric>
- Parameters:
oNumeric
- given object.- Returns:
- a sum.
-
psySub
Description copied from interface:PsyAdditive
Returns anadditive
representing the result of arithmetic subtraction of given object from this object.- Specified by:
psySub
in interfacePsyAdditive<PsyNumeric>
- Parameters:
oNumeric
- given object.- Returns:
- a difference.
-
psyMul
Description copied from interface:PsyMultiplicative
Returns a result of arithmetic multiplication of given object by this object.- Specified by:
psyMul
in interfacePsyMultiplicative<PsyNumeric>
- Parameters:
oNumeric
- a given object.- Returns:
- a product.
-
psyDiv
Description copied from interface:PsyMultiplicative
Returns a result of arithmetic division of this object by given object.- Specified by:
psyDiv
in interfacePsyMultiplicative<PsyNumeric>
- Parameters:
oNumeric
- a given object.- Returns:
- a fraction.
-
psyPow
- Specified by:
psyPow
in interfacePsyNumeric
- Throws:
PsyErrorException
-
psyExp
Description copied from interface:PsyNumeric
Returns anumeric
representing the exponent of this object.- Specified by:
psyExp
in interfacePsyNumeric
- Returns:
- a
numeric
exponent.
-
psyCos
Description copied from interface:PsyNumeric
Returns anumeric
representing the cosine of this object.- Specified by:
psyCos
in interfacePsyNumeric
- Returns:
- a
numeric
cosine.
-
psySin
Description copied from interface:PsyNumeric
Returns anumeric
representing the sine of this object.- Specified by:
psySin
in interfacePsyNumeric
- Returns:
- a
numeric
sine.
-
psyLog
Description copied from interface:PsyNumeric
Returns anumeric
representing the natural logarithm of this object.- Specified by:
psyLog
in interfacePsyNumeric
- Returns:
- a
numeric
logarithm.
-
psyAcos
Description copied from interface:PsyNumeric
Returns anumeric
representing the arc cosine of this object.- Specified by:
psyAcos
in interfacePsyNumeric
- Returns:
- a
numeric
arc cosine.
-
psyAsin
Description copied from interface:PsyNumeric
Returns anumeric
representing the arc sine of this object.- Specified by:
psyAsin
in interfacePsyNumeric
- Returns:
- a
numeric
arc sine.
-
psyAtan
Description copied from interface:PsyNumeric
Returns anumeric
representing the arc tangent of this object.- Specified by:
psyAtan
in interfacePsyNumeric
- Returns:
- a
numeric
arc tangent.
-
psySqrt
Description copied from interface:PsyNumeric
Returns anumeric
representing the square root of this object.- Specified by:
psySqrt
in interfacePsyNumeric
- Returns:
- a
numeric
square root of this number.
-
psyCbrt
Description copied from interface:PsyNumeric
Returns anumeric
representing the cubic root of this object.- Specified by:
psyCbrt
in interfacePsyNumeric
- Returns:
- a
numeric
cubic root of this number.
-
psyCosh
Description copied from interface:PsyNumeric
Returns anumeric
representing the hyperbolic cosine of this object.- Specified by:
psyCosh
in interfacePsyNumeric
- Returns:
- a
numeric
hyperbolic cosine of this number.
-
psyTan
Description copied from interface:PsyNumeric
Returns anumeric
representing the tangent of this object.- Specified by:
psyTan
in interfacePsyNumeric
- Returns:
- a
numeric
tangent.
-
psySinh
Description copied from interface:PsyNumeric
Returns anumeric
representing the hyperbolic sine of this object.- Specified by:
psySinh
in interfacePsyNumeric
- Returns:
- a
numeric
hyperbolic sine of this number.
-
psyTanh
Description copied from interface:PsyNumeric
Returns anumeric
representing the hyperbolic tangent of this object.- Specified by:
psyTanh
in interfacePsyNumeric
- Returns:
- a
numeric
hyperbolic tangent of this number.
-
psyFromPolar
-
psyFromPolar
-