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 ofcomplexobject.
-
-
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 anumericabsolute value of this object.PsyComplexpsyAcos()Returns anumericrepresenting the arc cosine of this object.PsyComplexpsyAdd(PsyNumeric oNumeric)Returns anadditiverepresenting the result of arithmetic addition of given object to this object.PsyRealpsyArg()Returns arealrepresenting the complex argument of this object.PsyComplexpsyAsin()Returns anumericrepresenting the arc sine of this object.PsyComplexpsyAtan()Returns anumericrepresenting the arc tangent of this object.PsyComplexpsyCbrt()Returns anumericrepresenting the cubic root of this object.PsyComplexpsyConjugate()Returns acomplexrepresenting the complex conjugate of this object.PsyComplexpsyCos()Returns anumericrepresenting the cosine of this object.PsyComplexpsyCosh()Returns anumericrepresenting the hyperbolic cosine of this object.PsyComplexpsyDiv(PsyNumeric oNumeric)Returns a result of arithmetic division of this object by given object.PsyComplexpsyExp()Returns anumericrepresenting the exponent of this object.static PsyComplexpsyFromPolar(double abs, double arg)static PsyComplexpsyFromPolar(PsyRealNumeric oAbs, PsyRealNumeric oArg)PsyRealpsyImagPart()Returns arealimaginary part of this object.PsyBooleanpsyIsZero()Returns abooleanindicating whether this object represents a zero value.PsyComplexpsyLog()Returns anumericrepresenting the natural logarithm of this object.PsyComplexpsyMul(PsyNumeric oNumeric)Returns a result of arithmetic multiplication of given object by this object.PsyComplexpsyNeg()Returns anadditiverepresenting the result of arithmetic negation of this object.PsyNumericpsyPow(PsyNumeric oNumeric)PsyRealpsyRealPart()Returns arealreal part of this object.PsyComplexpsySin()Returns anumericrepresenting the sine of this object.PsyComplexpsySinh()Returns anumericrepresenting the hyperbolic sine of this object.PsyComplexpsySqrt()Returns anumericrepresenting the square root of this object.PsyComplexpsySub(PsyNumeric oNumeric)Returns anadditiverepresenting the result of arithmetic subtraction of given object from this object.PsyComplexpsyTan()Returns anumericrepresenting the tangent of this object.PsyComplexpsyTanh()Returns anumericrepresenting 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 abooleanindicating 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 anumericabsolute 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 arealreal part of this object.- Returns:
- a
realreal part.
-
psyImagPart
public PsyReal psyImagPart()
Returns arealimaginary part of this object.- Returns:
- a
realimaginary part.
-
psyArg
public PsyReal psyArg()
Returns arealrepresenting the complex argument of this object. The argument belongs to the range (−π; π].- Returns:
- a
realargument.
-
psyConjugate
public PsyComplex psyConjugate()
Returns acomplexrepresenting the complex conjugate of this object.- Returns:
- a
complexconjugate of this number.
-
psyNeg
public PsyComplex psyNeg()
Description copied from interface:PsyAdditiveReturns anadditiverepresenting 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 anadditiverepresenting 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 anadditiverepresenting 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 PsyErrorException
- Specified by:
psyPowin interfacePsyNumeric- Throws:
PsyErrorException
-
psyExp
public PsyComplex psyExp()
Description copied from interface:PsyNumericReturns anumericrepresenting the exponent of this object.- Specified by:
psyExpin interfacePsyNumeric- Returns:
- a
numericexponent.
-
psyCos
public PsyComplex psyCos()
Description copied from interface:PsyNumericReturns anumericrepresenting the cosine of this object.- Specified by:
psyCosin interfacePsyNumeric- Returns:
- a
numericcosine.
-
psySin
public PsyComplex psySin()
Description copied from interface:PsyNumericReturns anumericrepresenting the sine of this object.- Specified by:
psySinin interfacePsyNumeric- Returns:
- a
numericsine.
-
psyLog
public PsyComplex psyLog()
Description copied from interface:PsyNumericReturns anumericrepresenting the natural logarithm of this object.- Specified by:
psyLogin interfacePsyNumeric- Returns:
- a
numericlogarithm.
-
psyAcos
public PsyComplex psyAcos()
Description copied from interface:PsyNumericReturns anumericrepresenting the arc cosine of this object.- Specified by:
psyAcosin interfacePsyNumeric- Returns:
- a
numericarc cosine.
-
psyAsin
public PsyComplex psyAsin()
Description copied from interface:PsyNumericReturns anumericrepresenting the arc sine of this object.- Specified by:
psyAsinin interfacePsyNumeric- Returns:
- a
numericarc sine.
-
psyAtan
public PsyComplex psyAtan()
Description copied from interface:PsyNumericReturns anumericrepresenting the arc tangent of this object.- Specified by:
psyAtanin interfacePsyNumeric- Returns:
- a
numericarc tangent.
-
psySqrt
public PsyComplex psySqrt()
Description copied from interface:PsyNumericReturns anumericrepresenting 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 anumericrepresenting 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 anumericrepresenting 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 anumericrepresenting the tangent of this object.- Specified by:
psyTanin interfacePsyNumeric- Returns:
- a
numerictangent.
-
psySinh
public PsyComplex psySinh()
Description copied from interface:PsyNumericReturns anumericrepresenting 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 anumericrepresenting 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)
-
-