public static double[,] Im(this Complex[,] c)
{
if (c == null)
throw new ArgumentNullException("c");
int rows = c.GetLength(0);
int cols = c.GetLength(1);
var im = new double[rows, cols];
for (int i = 0; i < rows; i++)
for (int j = 0; j < cols; j++)
im[i, j] = c[i, j].Imaginary;
return im;
}