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