mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 15:30:09 -08:00
Add cos.
This commit is contained in:
parent
9b71f9aaf4
commit
8cf0c94947
|
@ -308,6 +308,19 @@ public class StandardPlugin extends Plugin {
|
|||
}
|
||||
};
|
||||
|
||||
public static final Function FUNCTION_COS = new Function() {
|
||||
@Override
|
||||
protected boolean matchesParams(NumberInterface[] params) {
|
||||
return params.length == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NumberInterface applyInternal(NumberInterface[] params) {
|
||||
return FUNCTION_SIN.apply(getPi(params[0].getClass()).divide(new NaiveNumber(2).promoteTo(params[0].getClass()))
|
||||
.subtract(params[0]));
|
||||
}
|
||||
};
|
||||
|
||||
public StandardPlugin(PluginManager manager) {
|
||||
super(manager);
|
||||
}
|
||||
|
@ -355,6 +368,7 @@ public class StandardPlugin extends Plugin {
|
|||
registerFunction("ln", FUNCTION_LN);
|
||||
registerFunction("sqrt", FUNCTION_SQRT);
|
||||
registerFunction("sin", FUNCTION_SIN);
|
||||
registerFunction("cos", FUNCTION_COS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user