This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function factorialize(num) { | |
product=1; | |
var fast =[]; | |
if(num>0){ | |
var ghr= num; | |
for(i=1;i<=ghr;i++){ | |
fast.push(i); | |
} | |
for(i=0;i<fast.length;i++){ | |
product=product*fast[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var matrix=[]; | |
function Solve(matrix) { | |
var Det = matrix[0][0]*(matrix[1][1]*matrix[2][2] - matrix[1][2]*matrix[2][1])-matrix[0][1]*(matrix[1][0]*matrix[1][1]-matrix[1][2]*matrix[2][0])+matrix[0][2]*(matrix[1][0]*matrix[2][1]-matrix[1][1]*matrix[2][0]); | |
return Det; | |
} | |
Solve([[1,2,2],[3,4,5],[4,5,6]]);//Here goes your three cross three matrix; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var matrix = []; | |
function Solve(matrix) { | |
var Det = matrix[0][0]*matrix[1][1] - matrix[0][1]*matrix[1][0]; | |
return Det; | |
} | |
Solve([[1,2], | |
[3,4]]); // Here goes your matrix and you'll got you determinant; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var marks = []; | |
var total = 0 ; | |
function Calculate(marks) { | |
for(i=0; i < marks.length ; i++) { | |
total = total + marks[i]; | |
var percentage = total/marks.length ; | |
} return percentage; | |
} | |
Calculate([97,93,94]) ; // here comes your marks | |
// no matter the number of subjects, its Auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// complex number is usually in the form z = a + ib ; | |
//and here we are going to return the magnitude of this complex number by using Javascript ; | |
// As we know that, magnitude of complex number (r)= (a^2 + b^2)^1/2 | |
var complex = [a,b]; | |
var r = 0; | |
function valueR(complex) { | |
var rvalue = r + Math.pow(complex[0],2) + Math.pow(complex[1],2); | |
rvalue = Math.sqrt(rvalue); |
NewerOlder