You're here: Home / Math /

Determinant of 2-by-2 matrices

The determinant of 2x2 matrices is defined as follows:

abs matrix { a # b ## c # d } = ad - bc

And the code cannot be simpler,

<script type="text/javascript">

/* parameter m is 2-by-2 matrix */
function det2x2(m) {
  return( ( m[0][0] * m[1][1] ) - ( m[0][1] * m[1][0] ) );
}

</script>

Keywords: determinant, 2-by-2 matrices, matrix, script

Share:  del.icio.us logo Save to del.icio.us  digg logo Digg this!

comment.gifAdd your comment

(required, will not be published) (optional)