Package tools
Class DefaultFunctions
Object
DefaultFunctions
public class DefaultFunctions
extends Object
DefaultFunctions
contains instances of many often-used GeneralFunction
s 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 Constant
E
AConstant
with the value ofe
static Constant
HALF
AConstant
with the value of0.5
static Constant
HALF_PI
AConstant
with the value ofπ/2
static Constant
NEGATIVE_HALF
AConstant
with the value of-0.5
static Constant
NEGATIVE_ONE
AConstant
with the value of-1
static Constant
NEGATIVE_TWO
AConstant
with the value of-2
static Constant
ONE
AConstant
with the value of1
static Constant
PI
AConstant
with the value ofπ
static Constant
TEN
AConstant
with the value of10
static Constant
TWO
AConstant
with the value of2
static Constant
TWO_PI
AConstant
with the value of2π
static Variable
X
AVariable
with the variable ID ofx
static Variable
Y
AVariable
with the variable ID ofy
static Variable
Z
AVariable
with the variable ID ofz
static Constant
ZERO
AConstant
with the value of0
-
Method Summary
Modifier and Type Method Description static GeneralFunction
choose(GeneralFunction n, GeneralFunction r)
Returns the the function corresponding tonCr
static Product
frac(GeneralFunction numerator, GeneralFunction denominator)
Returns the the function corresponding tofirst/second
static Logb
log10(GeneralFunction input)
static Product
negative(GeneralFunction input)
static GeneralFunction
permute(GeneralFunction n, GeneralFunction r)
Returns the the function corresponding tonPr
static Pow
reciprocal(GeneralFunction input)
static Pow
sqrt(GeneralFunction input)
static Pow
square(GeneralFunction input)
static Sum
subtract(GeneralFunction first, GeneralFunction second)
Returns the the function corresponding tofirst - second
-
Field Details
-
NEGATIVE_TWO
AConstant
with the value of-2
-
NEGATIVE_ONE
AConstant
with the value of-1
-
NEGATIVE_HALF
AConstant
with the value of-0.5
-
ZERO
AConstant
with the value of0
-
HALF
AConstant
with the value of0.5
-
ONE
AConstant
with the value of1
-
TWO
AConstant
with the value of2
-
TEN
AConstant
with the value of10
-
HALF_PI
AConstant
with the value ofπ/2
-
PI
AConstant
with the value ofπ
-
TWO_PI
AConstant
with the value of2π
-
E
AConstant
with the value ofe
-
X
AVariable
with the variable ID ofx
-
Y
AVariable
with the variable ID ofy
-
Z
AVariable
with the variable ID ofz
-
-
Method Details
-
negative
- Parameters:
input
- the inputGeneralFunction
- Returns:
- a
Product
ofNEGATIVE_ONE
and theinput
-
reciprocal
- Parameters:
input
- the inputGeneralFunction
- Returns:
- a
Pow
ofinput
to the power ofNEGATIVE_ONE
-
sqrt
- Parameters:
input
- the inputGeneralFunction
- Returns:
- a
Pow
ofinput
to the power ofHALF
-
square
- Parameters:
input
- the inputGeneralFunction
- Returns:
- a
Pow
ofinput
to the power ofTWO
-
log10
- Parameters:
input
- the inputGeneralFunction
- Returns:
- a
Logb
baseTEN
ofinput
-
choose
Returns the the function corresponding tonCr
- Parameters:
n
- the inputGeneralFunction
r
- the inputGeneralFunction
- Returns:
- the the function corresponding to
nCr
-
permute
Returns the the function corresponding tonPr
- Parameters:
n
- the inputGeneralFunction
r
- the inputGeneralFunction
- Returns:
- the the function corresponding to
nCr
-
frac
Returns the the function corresponding tofirst/second
- Parameters:
numerator
- the inputGeneralFunction
denominator
- the inputGeneralFunction
- Returns:
- the the function corresponding to
first/second
-
subtract
Returns the the function corresponding tofirst - second
- Parameters:
first
- the inputGeneralFunction
second
- the inputGeneralFunction
- Returns:
- the the function corresponding to
first - second
-