Commit 06ecfc3d authored by GoshaZotov's avatar GoshaZotov

add IMTAN formula

parent d8ab4f64
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
cFormulaFunctionGroup['DateAndTime'].push(cDAYS, cISOWEEKNUM); cFormulaFunctionGroup['DateAndTime'].push(cDAYS, cISOWEEKNUM);
cFormulaFunctionGroup['Engineering'] = cFormulaFunctionGroup['Engineering'] || []; cFormulaFunctionGroup['Engineering'] = cFormulaFunctionGroup['Engineering'] || [];
cFormulaFunctionGroup['Engineering'].push(cBITAND, cBITLSHIFT, cBITOR, cBITRSHIFT, cBITXOR, cERF_PRECISE, cFormulaFunctionGroup['Engineering'].push(cBITAND, cBITLSHIFT, cBITOR, cBITRSHIFT, cBITXOR, cERF_PRECISE,
cERFC_PRECISE, cIMCSC, cIMCSCH, cIMSEC, cIMSECH, cIMSINH, cIMTAN); cERFC_PRECISE, cIMCSC, cIMCSCH, cIMSEC, cIMSECH, cIMSINH);
cFormulaFunctionGroup['TextAndData'] = cFormulaFunctionGroup['TextAndData'] || []; cFormulaFunctionGroup['TextAndData'] = cFormulaFunctionGroup['TextAndData'] || [];
cFormulaFunctionGroup['TextAndData'].push(cDBCS, cNUMBERVALUE, cUNICHAR, cUNICODE); cFormulaFunctionGroup['TextAndData'].push(cDBCS, cNUMBERVALUE, cUNICHAR, cUNICODE);
cFormulaFunctionGroup['Statistical'] = cFormulaFunctionGroup['Statistical'] || []; cFormulaFunctionGroup['Statistical'] = cFormulaFunctionGroup['Statistical'] || [];
...@@ -676,18 +676,6 @@ ...@@ -676,18 +676,6 @@
cIMSINH.prototype = Object.create(cBaseFunction.prototype); cIMSINH.prototype = Object.create(cBaseFunction.prototype);
cIMSINH.prototype.constructor = cIMSINH; cIMSINH.prototype.constructor = cIMSINH;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMTAN() {
cBaseFunction.call(this, "IMTAN");
this.isXLFN = true;
}
cIMTAN.prototype = Object.create(cBaseFunction.prototype);
cIMTAN.prototype.constructor = cIMTAN;
/** /**
* @constructor * @constructor
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
......
...@@ -476,6 +476,14 @@ ...@@ -476,6 +476,14 @@
} else { } else {
this.real = Math.cos(this.real); this.real = Math.cos(this.real);
} }
}, Tan: function () {
if (this.img) {
var a = Math.sin(2 * this.real) / (Math.cos(2 * this.real) + Math.cosh(2 * this.img));
this.img = Math.sinh(2 * this.img) / (Math.cos(2 * this.real) + Math.cosh(2 * this.img));
this.real = a;
} else {
this.real = Math.tan(this.real);
}
}, Cot: function () { }, Cot: function () {
if (this.img) { if (this.img) {
var a = Math.sin(2 * this.real) / (Math.cosh(2 * this.img) - Math.cos(2 * this.real)); var a = Math.sin(2 * this.real) / (Math.cosh(2 * this.img) - Math.cos(2 * this.real));
...@@ -890,7 +898,7 @@ ...@@ -890,7 +898,7 @@
cFormulaFunctionGroup['Engineering'].push(cBESSELI, cBESSELJ, cBESSELK, cBESSELY, cBIN2DEC, cBIN2HEX, cBIN2OCT, cFormulaFunctionGroup['Engineering'].push(cBESSELI, cBESSELJ, cBESSELK, cBESSELY, cBIN2DEC, cBIN2HEX, cBIN2OCT,
cCOMPLEX, cCONVERT, cDEC2BIN, cDEC2HEX, cDEC2OCT, cDELTA, cERF, cERFC, cGESTEP, cHEX2BIN, cHEX2DEC, cHEX2OCT, cCOMPLEX, cCONVERT, cDEC2BIN, cDEC2HEX, cDEC2OCT, cDELTA, cERF, cERFC, cGESTEP, cHEX2BIN, cHEX2DEC, cHEX2OCT,
cIMABS, cIMAGINARY, cIMARGUMENT, cIMCONJUGATE, cIMCOS, cIMCOSH, cIMCOT, cIMDIV, cIMEXP, cIMLN, cIMLOG10, cIMLOG2, cIMPOWER, cIMABS, cIMAGINARY, cIMARGUMENT, cIMCONJUGATE, cIMCOS, cIMCOSH, cIMCOT, cIMDIV, cIMEXP, cIMLN, cIMLOG10, cIMLOG2, cIMPOWER,
cIMPRODUCT, cIMREAL, cIMSIN, cIMSQRT, cIMSUB, cIMSUM, cOCT2BIN, cOCT2DEC, cOCT2HEX); cIMPRODUCT, cIMREAL, cIMSIN, cIMSQRT, cIMSUB, cIMSUM, cIMTAN, cOCT2BIN, cOCT2DEC, cOCT2HEX);
/** /**
* @constructor * @constructor
...@@ -2901,6 +2909,58 @@ ...@@ -2901,6 +2909,58 @@
}; };
}; };
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cIMTAN() {
cBaseFunction.call(this, "IMTAN");
}
//TODO проверить!!!
cIMTAN.prototype = Object.create(cBaseFunction.prototype);
cIMTAN.prototype.constructor = cIMTAN;
cIMTAN.prototype.argumentsMin = 1;
cIMTAN.prototype.argumentsMax = 1;
cIMTAN.prototype.isXLFN = true;
cIMTAN.prototype.Calculate = function (arg) {
var arg0 = arg[0];
if (arg0 instanceof cArea || arg0 instanceof cArea3D) {
arg0 = arg0.cross(arguments[1]);
} else if (arg0 instanceof cArray) {
arg0 = arg0.getElementRowCol(0, 0);
}
arg0 = arg0.tocString();
if (arg0 instanceof cError) {
return this.value = arg0;
}
if(arg0.value === true || arg0.value === false){
return this.value = new cError(cErrorType.wrong_value_type);
}
var c = new Complex(arg0.toString());
if (c instanceof cError) {
return this.value = c;
}
c.Tan();
this.value = new cString(c.toString());
this.value.numFormat = 0;
return this.value;
};
cIMTAN.prototype.getInfo = function () {
return {
name: this.name, args: "( complex-number )"
};
};
/** /**
* @constructor * @constructor
* @extends {AscCommonExcel.cBaseFunction} * @extends {AscCommonExcel.cBaseFunction}
......
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