public class EngineeringCalculator extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
| Constructor and Description |
|---|
EngineeringCalculator() |
| Modifier and Type | Method and Description |
|---|---|
protected static Ptg |
calcBin2Dec(Ptg[] operands)
BIN2DEC
Converts a binary number to decimal
|
protected static Ptg |
calcBin2Hex(Ptg[] operands)
BIN2HEX
Converts a binary number to hexadecimal
|
protected static Ptg |
calcBin2Oct(Ptg[] operands)
BIN2OCT
Converts a binary number to octal
|
protected static Ptg |
calcComplex(Ptg[] operands)
COMPLEX
Converts real and imaginary coefficients into a complex number
|
protected static Ptg |
calcConvert(Ptg[] operands) |
protected static Ptg |
calcDec2Bin(Ptg[] operands)
DEC2BIN
Converts a decimal number to binary
|
protected static Ptg |
calcDec2Hex(Ptg[] operands)
DEC2HEX
Converts a decimal number to hexadecimal
|
protected static Ptg |
calcDec2Oct(Ptg[] operands)
DEC2OCT
Converts a decimal number to octal
|
protected static Ptg |
calcDelta(Ptg[] operands)
DELTA
Tests whether two values are equal
|
protected static Ptg |
calcErf(Ptg[] operands)
ERF
Returns the error function integrated between lower_limit and upper_limit.
|
protected static Ptg |
calcGEStep(Ptg[] operands)
GESTEP
Tests whether a number is greater than a threshold value
|
protected static Ptg |
calcHex2Bin(Ptg[] operands)
HEX2BIN
Converts a hexadecimal number to binary
|
protected static Ptg |
calcHex2Dec(Ptg[] operands)
HEX2DEC
Converts a hexadecimal number to decimal
|
protected static Ptg |
calcHex2Oct(Ptg[] operands)
HEX2OCT
Converts a hexadecimal number to octal
|
protected static Ptg |
calcImAbs(Ptg[] operands)
IMABS
Returns the absolute value (modulus) of a complex number
|
protected static Ptg |
calcImaginary(Ptg[] operands)
IMAGINARY
Returns the imaginary coefficient of a complex number
|
protected static Ptg |
calcImArgument(Ptg[] operands)
IMARGUMENT
Returns the argument theta, an angle expressed in radians
|
protected static Ptg |
calcImConjugate(Ptg[] operands)
IMCONJUGATE
Returns the complex conjugate of a complex number
|
protected static Ptg |
calcImCos(Ptg[] operands)
IMCOS
Returns the cosine of a complex number
|
protected static Ptg |
calcImDiv(Ptg[] operands)
IMDIV
Returns the quotient of two complex numbers, defined as (deep breath):
(r1 + i1j)/(r2 + i2j) == ( r1r2 + i1i2 + (r2i1 - r1i2)i ) / (r2^2 + i2^2)
|
protected static Ptg |
calcImExp(Ptg[] operands)
IMEXP
Returns the exponential of a complex number
|
protected static Ptg |
calcImLn(Ptg[] operands)
IMLN
Returns the natural logarithm of a complex number
|
protected static Ptg |
calcImLog10(Ptg[] operands)
IMLOG10
Returns the base-10 logarithm of a complex number
|
protected static Ptg |
calcImLog2(Ptg[] operands)
IMLOG2
Returns the base-2 logarithm of a complex number
|
protected static Ptg |
calcImPower(Ptg[] operands)
IMPOWER
Returns a complex number raised to any power
|
protected static Ptg |
calcImProduct(Ptg[] operands)
IMPRODUCT
Returns the product of two complex numbers
|
protected static Ptg |
calcImReal(Ptg[] operands)
IMREAL
Returns the real coefficient of a complex number
|
protected static Ptg |
calcImSin(Ptg[] operands)
IMSIN
Returns the sine of a complex number
|
protected static Ptg |
calcImSqrt(Ptg[] operands)
IMSQRT
Returns the square root of a complex number
|
protected static Ptg |
calcImSub(Ptg[] operands)
IMSUB
Returns the difference of two complex numbers
|
protected static Ptg |
calcImSum(Ptg[] operands)
IMSUM
Returns the sum of complex numbers
|
protected static Ptg |
calcOct2Bin(Ptg[] operands)
OCT2BIN
Converts an octal number to binary
|
protected static Ptg |
calcOct2Dec(Ptg[] operands)
OCT2DEC
Converts an octal number to decimal
|
protected static Ptg |
calcOct2Hex(Ptg[] operands)
OCT2HEX
Converts an octal number to hexadecimal
|
static double |
erf(double x)
Calculate the error function erf.
|
static double |
erfc(double x)
Calculate the remaining error function erfc.
|
static boolean |
hasConverged(double xn,
double xo,
double eps,
int n,
int max)
Indicate if an iterative algorithm has RELATIVE converged.
|
static boolean |
hasReachedAccuracy(double xn,
double xo,
double eps)
Indicate if xn and xo have the relative/absolute accuracy epsilon.
|
protected static Ptg calcBin2Dec(Ptg[] operands)
protected static Ptg calcBin2Hex(Ptg[] operands)
protected static Ptg calcBin2Oct(Ptg[] operands)
protected static Ptg calcComplex(Ptg[] operands)
protected static Ptg calcDec2Bin(Ptg[] operands)
protected static Ptg calcDec2Hex(Ptg[] operands)
protected static Ptg calcDec2Oct(Ptg[] operands)
protected static Ptg calcErf(Ptg[] operands) throws FunctionNotSupportedException
FunctionNotSupportedExceptionpublic static double erf(double x)
x - the argumentpublic static double erfc(double x)
x - the argumentpublic static boolean hasConverged(double xn,
double xo,
double eps,
int n,
int max)
xn - the actual argument x[n]xo - the older argument x[n-1]eps - the accuracy to reachn - the actual iteration countermax - the maximal number of iterationspublic static boolean hasReachedAccuracy(double xn,
double xo,
double eps)
2*|x[n]-x[n-1]|/|x[n]+x[n-1]| < eps
xn - the actual argument x[n]xo - the older argument x[n-1]eps - accuracy to reachprotected static Ptg calcGEStep(Ptg[] operands)
protected static Ptg calcHex2Bin(Ptg[] operands)
protected static Ptg calcHex2Dec(Ptg[] operands)
protected static Ptg calcHex2Oct(Ptg[] operands)
protected static Ptg calcImAbs(Ptg[] operands)
protected static Ptg calcImaginary(Ptg[] operands)
protected static Ptg calcImArgument(Ptg[] operands)
protected static Ptg calcImConjugate(Ptg[] operands)
protected static Ptg calcImCos(Ptg[] operands)
protected static Ptg calcImDiv(Ptg[] operands)
protected static Ptg calcImExp(Ptg[] operands)
protected static Ptg calcImLn(Ptg[] operands)
protected static Ptg calcImLog10(Ptg[] operands)
protected static Ptg calcImLog2(Ptg[] operands)
protected static Ptg calcImPower(Ptg[] operands)
protected static Ptg calcImProduct(Ptg[] operands)
protected static Ptg calcImReal(Ptg[] operands)
protected static Ptg calcImSqrt(Ptg[] operands)
protected static Ptg calcImSub(Ptg[] operands)
protected static Ptg calcOct2Bin(Ptg[] operands)
protected static Ptg calcOct2Dec(Ptg[] operands)
Copyright © 2002–2019 Starter Inc.. All rights reserved.