Commit 5f901ed0 authored by GoshaZotov's avatar GoshaZotov

add BESSELJ formula

parent 89ab2b0e
......@@ -943,7 +943,7 @@
cOCT2DEC, cOCT2HEX);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cBESSELI, cBESSELJ, cBESSELK, cBESSELY, cCONVERT);
cFormulaFunctionGroup['NotRealised'].push(cBESSELI, cBESSELK, cBESSELY, cCONVERT);
/**
* @constructor
......@@ -1010,6 +1010,51 @@
cBESSELJ.prototype = Object.create(cBaseFunction.prototype);
cBESSELJ.prototype.constructor = cBESSELJ;
cBESSELJ.prototype.argumentsMin = 2;
cBESSELJ.prototype.argumentsMax = 2;
cBESSELJ.prototype.Calculate = function ( arg ) {
var x = arg[0],
n = arg[1];
if ( x instanceof cArea || x instanceof cArea3D ) {
x = x.cross( arguments[1] );
}
else if ( x instanceof cArray ) {
x = x.getElementRowCol( 0, 0 );
}
if ( n instanceof cArea || n instanceof cArea3D ) {
n = n.cross( arguments[1] );
}
else if ( n instanceof cArray ) {
n = n.getElementRowCol( 0, 0 );
}
x = x.tocNumber();
n = n.tocNumber();
if ( x instanceof cError ) {
return this.value = x;
}
if ( n instanceof cError ) {
return this.value = n;
}
x = x.getValue();
n = n.getValue();
if ( n < 0 ){
return this.value = new cError( cErrorType.not_numeric );
}
if(x < 0){
x = Math.abs(x);
}
n = Math.floor(n);
this.value = BesselJ( x, n );
return this.value;
};
/**
* @constructor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment