js实现三阶/矩阵行列式代码教程
js三阶/矩阵行列式怎么实现,js实现三阶/矩阵行列式代码教程如下:
1.自定义一阶数据a,b,c;
2.自定义二阶数据d,e,f;
3.自定义三阶数据g,h,i;
计算出:矩阵数值
js代码:
function calculate() {
var c = new Number(); var a,b,m,u,ua,ia,ib,ic,id,ie,ij,ix,iy,iz,oa;ia=parseFloat(document.calculator.ia.value);ib=parseFloat(document.calculator.ib.value);ic=parseFloat(document.calculator.ic.value);id=parseFloat(document.calculator.id.value);ie=parseFloat(document.calculator.ie.value);ij=parseFloat(document.calculator.ij.value);ix=parseFloat(document.calculator.ix.value);iy=parseFloat(document.calculator.iy.value);iz=parseFloat(document.calculator.iz.value);
oa = (ia*((ie*iz)-(ij*iy)))-(ib*((id*iz)-(ij*ix)))+(ic*((id*iy)-(ie*ix)));
if(oa.toPrecision) { oa=oa.toPrecision(6); } document.calculator.oa.value = oa;
return false;
}
显示效果:http://www.chinawe.net/tools/sanjie/
参考文章:http://tishang.net/articles/1685326500.html