Package tools
Class DefaultFunctions
Object
DefaultFunctions
public class DefaultFunctions
extends Object
DefaultFunctions contains instances of many often-used GeneralFunctions so that they need not be re-instantiated repeatedly, as well as shortcuts for the negative and inverse of a GeneralFunction.-
Field Summary
Fields Modifier and Type Field Description static ConstantEAConstantwith the value ofestatic ConstantHALFAConstantwith the value of0.5static ConstantHALF_PIAConstantwith the value ofπ/2static ConstantNEGATIVE_HALFAConstantwith the value of-0.5static ConstantNEGATIVE_ONEAConstantwith the value of-1static ConstantNEGATIVE_TWOAConstantwith the value of-2static ConstantONEAConstantwith the value of1static ConstantPIAConstantwith the value ofπstatic ConstantTENAConstantwith the value of10static ConstantTWOAConstantwith the value of2static ConstantTWO_PIAConstantwith the value of2πstatic VariableXAVariablewith the variable ID ofxstatic VariableYAVariablewith the variable ID ofystatic VariableZAVariablewith the variable ID ofzstatic ConstantZEROAConstantwith the value of0 -
Method Summary
Modifier and Type Method Description static GeneralFunctionchoose(GeneralFunction n, GeneralFunction r)Returns the the function corresponding tonCrstatic Productfrac(GeneralFunction numerator, GeneralFunction denominator)Returns the the function corresponding tofirst/secondstatic Logblog10(GeneralFunction input)static Productnegative(GeneralFunction input)static GeneralFunctionpermute(GeneralFunction n, GeneralFunction r)Returns the the function corresponding tonPrstatic Powreciprocal(GeneralFunction input)static Powsqrt(GeneralFunction input)static Powsquare(GeneralFunction input)static Sumsubtract(GeneralFunction first, GeneralFunction second)Returns the the function corresponding tofirst - second
-
Field Details
-
NEGATIVE_TWO
AConstantwith the value of-2 -
NEGATIVE_ONE
AConstantwith the value of-1 -
NEGATIVE_HALF
AConstantwith the value of-0.5 -
ZERO
AConstantwith the value of0 -
HALF
AConstantwith the value of0.5 -
ONE
AConstantwith the value of1 -
TWO
AConstantwith the value of2 -
TEN
AConstantwith the value of10 -
HALF_PI
AConstantwith the value ofπ/2 -
PI
AConstantwith the value ofπ -
TWO_PI
AConstantwith the value of2π -
E
AConstantwith the value ofe -
X
AVariablewith the variable ID ofx -
Y
AVariablewith the variable ID ofy -
Z
AVariablewith the variable ID ofz
-
-
Method Details
-
negative
- Parameters:
input- the inputGeneralFunction- Returns:
- a
ProductofNEGATIVE_ONEand theinput
-
reciprocal
- Parameters:
input- the inputGeneralFunction- Returns:
- a
Powofinputto the power ofNEGATIVE_ONE
-
sqrt
- Parameters:
input- the inputGeneralFunction- Returns:
- a
Powofinputto the power ofHALF
-
square
- Parameters:
input- the inputGeneralFunction- Returns:
- a
Powofinputto the power ofTWO
-
log10
- Parameters:
input- the inputGeneralFunction- Returns:
- a
LogbbaseTENofinput
-
choose
Returns the the function corresponding tonCr- Parameters:
n- the inputGeneralFunctionr- the inputGeneralFunction- Returns:
- the the function corresponding to
nCr
-
permute
Returns the the function corresponding tonPr- Parameters:
n- the inputGeneralFunctionr- the inputGeneralFunction- Returns:
- the the function corresponding to
nCr
-
frac
Returns the the function corresponding tofirst/second- Parameters:
numerator- the inputGeneralFunctiondenominator- the inputGeneralFunction- Returns:
- the the function corresponding to
first/second
-
subtract
Returns the the function corresponding tofirst - second- Parameters:
first- the inputGeneralFunctionsecond- the inputGeneralFunction- Returns:
- the the function corresponding to
first - second
-