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 Ψ-complexobject.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyComplexIstatic PsyComplexMINUS_Istatic PsyComplexMINUS_ONEstatic PsyComplexONEstatic PsyOperator[]OPERATORSstatic PsyComplexTWOstatic PsyComplexZERO
-
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 doubleimagValue()Returns the real part of this object.PsyRealpsyAbs()Returns a Ψ-numericabsolute value of this object.PsyComplexpsyAcos()Returns a Ψ-numericrepresenting the arc cosine of this object.PsyComplexpsyAdd(PsyNumeric oNumeric)Returns a Ψ-additiverepresenting the result of arithmetic addition of given object to this object.PsyRealpsyArg()Returns a Ψ-realrepresenting the complex argument of this object.PsyComplexpsyAsin()Returns a Ψ-numericrepresenting the arc sine of this object.PsyComplexpsyAtan()Returns a Ψ-numericrepresenting the arc tangent of this object.PsyComplexpsyCbrt()Returns a Ψ-numericrepresenting the cubic root of this object.PsyComplexpsyConjugate()Returns a Ψ-complexrepresenting the complex conjugate of this object.PsyComplexpsyCos()Returns a Ψ-numericrepresenting the cosine of this object.PsyComplexpsyCosh()Returns a Ψ-numericrepresenting the hyperbolic cosine of this object.PsyComplexpsyDiv(PsyNumeric oNumeric)Returns a result of arithmetic division of this object by given object.PsyComplexpsyExp()Returns a Ψ-numericrepresenting the exponent of this object.static PsyComplexpsyFromPolar(double abs, double arg)static PsyComplexpsyFromPolar(PsyRealNumeric oAbs, PsyRealNumeric oArg)PsyRealpsyImagPart()Returns a Ψ-realimaginary part of this object.PsyBooleanpsyIsZero()Returns a Ψ-booleanindicating whether this object represents a zero value.PsyComplexpsyLog()Returns a Ψ-numericrepresenting the natural logarithm of this object.PsyComplexpsyMul(PsyNumeric oNumeric)Returns a result of arithmetic multiplication of given object by this object.PsyComplexpsyNeg()Returns a Ψ-additiverepresenting the result of arithmetic negation of this object.PsyNumericpsyPow(PsyNumeric oNumeric)PsyRealpsyRealPart()Returns a Ψ-realreal part of this object.PsyComplexpsySin()Returns a Ψ-numericrepresenting the sine of this object.PsyComplexpsySinh()Returns a Ψ-numericrepresenting the hyperbolic sine of this object.PsyComplexpsySqrt()Returns a Ψ-numericrepresenting the square root of this object.PsyComplexpsySub(PsyNumeric oNumeric)Returns a Ψ-additiverepresenting the result of arithmetic subtraction of given object from this object.PsyComplexpsyTan()Returns a Ψ-numericrepresenting the tangent of this object.PsyComplexpsyTanh()Returns a Ψ-numericrepresenting the hyperbolic tangent of this object.doublerealValue()Returns the real part of this object.StringtoSyntaxString()-
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
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
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:PsyNumericReturns the real part of this object.- Specified by:
realValuein interfacePsyNumeric- Returns:
- the real part.
-
imagValue
public double imagValue()
Description copied from interface:PsyNumericReturns the real part of this object.- Specified by:
imagValuein interfacePsyNumeric- Returns:
- the imaginary part.
-
psyIsZero
public PsyBoolean psyIsZero()
Description copied from interface:PsyArithmeticReturns a Ψ-booleanindicating whether this object represents a zero value.- Specified by:
psyIsZeroin interfacePsyArithmetic<PsyNumeric>- Returns:
PsyBoolean.TRUEif this object represents a zero value, andPsyBoolean.FALSEotherwise.
-
psyAbs
public PsyReal psyAbs()
Description copied from interface:PsyNumericReturns a Ψ-numericabsolute value of this object.- Specified by:
psyAbsin interfacePsyNumeric- Returns:
- a Ψ-
numericabsolute value.
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxStringin interfacePsyObject
-
psyRealPart
public PsyReal psyRealPart()
Returns a Ψ-realreal part of this object.- Returns:
- a Ψ-
realreal part.
-
psyImagPart
public PsyReal psyImagPart()
Returns a Ψ-realimaginary part of this object.- Returns:
- a Ψ-
realimaginary part.
-
psyArg
public PsyReal psyArg()
Returns a Ψ-realrepresenting the complex argument of this object. The argument belongs to the range (−π; π].- Returns:
- a Ψ-
realargument.
-
psyConjugate
public PsyComplex psyConjugate()
Returns a Ψ-complexrepresenting the complex conjugate of this object.- Returns:
- a Ψ-
complexconjugate of this number.
-
psyNeg
public PsyComplex psyNeg()
Description copied from interface:PsyAdditiveReturns a Ψ-additiverepresenting the result of arithmetic negation of this object.- Specified by:
psyNegin interfacePsyAdditive<PsyNumeric>- Returns:
- a negation.
-
psyAdd
public PsyComplex psyAdd(PsyNumeric oNumeric)
Description copied from interface:PsyAdditiveReturns a Ψ-additiverepresenting the result of arithmetic addition of given object to this object.- Specified by:
psyAddin interfacePsyAdditive<PsyNumeric>- Parameters:
oNumeric- given object.- Returns:
- a sum.
-
psySub
public PsyComplex psySub(PsyNumeric oNumeric)
Description copied from interface:PsyAdditiveReturns a Ψ-additiverepresenting the result of arithmetic subtraction of given object from this object.- Specified by:
psySubin interfacePsyAdditive<PsyNumeric>- Parameters:
oNumeric- given object.- Returns:
- a difference.
-
psyMul
public PsyComplex psyMul(PsyNumeric oNumeric)
Description copied from interface:PsyArithmeticReturns a result of arithmetic multiplication of given object by this object.- Specified by:
psyMulin interfacePsyArithmetic<PsyNumeric>- Parameters:
oNumeric- a given object.- Returns:
- a product.
-
psyDiv
public PsyComplex psyDiv(PsyNumeric oNumeric)
Description copied from interface:PsyArithmeticReturns a result of arithmetic division of this object by given object.- Specified by:
psyDivin interfacePsyArithmetic<PsyNumeric>- Parameters:
oNumeric- a given object.- Returns:
- a fraction.
-
psyPow
public PsyNumeric psyPow(PsyNumeric oNumeric) throws PsyException
- Specified by:
psyPowin interfacePsyNumeric- Throws:
PsyException
-
psyExp
public PsyComplex psyExp()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the exponent of this object.- Specified by:
psyExpin interfacePsyNumeric- Returns:
- a Ψ-
numericexponent.
-
psyCos
public PsyComplex psyCos()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the cosine of this object.- Specified by:
psyCosin interfacePsyNumeric- Returns:
- a Ψ-
numericcosine.
-
psySin
public PsyComplex psySin()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the sine of this object.- Specified by:
psySinin interfacePsyNumeric- Returns:
- a Ψ-
numericsine.
-
psyLog
public PsyComplex psyLog()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the natural logarithm of this object.- Specified by:
psyLogin interfacePsyNumeric- Returns:
- a Ψ-
numericlogarithm. value.
-
psyAcos
public PsyComplex psyAcos()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the arc cosine of this object.- Specified by:
psyAcosin interfacePsyNumeric- Returns:
- a Ψ-
numericarc cosine.
-
psyAsin
public PsyComplex psyAsin()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the arc sine of this object.- Specified by:
psyAsinin interfacePsyNumeric- Returns:
- a Ψ-
numericarc sine.
-
psyAtan
public PsyComplex psyAtan()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the arc tangent of this object.- Specified by:
psyAtanin interfacePsyNumeric- Returns:
- a Ψ-
numericarcc tangent.
-
psySqrt
public PsyComplex psySqrt()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the square root of this object.- Specified by:
psySqrtin interfacePsyNumeric- Returns:
- a Ψ-
numericsquare root of this number.
-
psyCbrt
public PsyComplex psyCbrt()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the cubic root of this object.- Specified by:
psyCbrtin interfacePsyNumeric- Returns:
- a Ψ-
numericcubic root of this number.
-
psyCosh
public PsyComplex psyCosh()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the hyperbolic cosine of this object.- Specified by:
psyCoshin interfacePsyNumeric- Returns:
- a Ψ-
numerichyperbolic cosine of this number.
-
psyTan
public PsyComplex psyTan()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the tangent of this object.- Specified by:
psyTanin interfacePsyNumeric- Returns:
- a Ψ-
numerictangent.
-
psySinh
public PsyComplex psySinh()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the hyperbolic sine of this object.- Specified by:
psySinhin interfacePsyNumeric- Returns:
- a Ψ-
numerichyperbolic sine of this number.
-
psyTanh
public PsyComplex psyTanh()
Description copied from interface:PsyNumericReturns a Ψ-numericrepresenting the hyperbolic tangent of this object.- Specified by:
psyTanhin interfacePsyNumeric- Returns:
- a Ψ-
numerichyperbolic tangent of this number.
-
psyFromPolar
public static PsyComplex psyFromPolar(PsyRealNumeric oAbs, PsyRealNumeric oArg)
-
psyFromPolar
public static PsyComplex psyFromPolar(double abs, double arg)
-
-