[ask] how to use an array of double in Java Processing

In Java, when we declare a variable as of datatype array, we don’t specify its dimension there.
We merely use empty [] square brackets. :coffee:

So instead of C’s double param1[6][14] = {{.
In Java we remove those dimension values at the left side of the assignment: double param1[][] = {{.
Or even better, place the square brackets right after its datatype: double[][] param1 = {{.

final double[][] param1 = {
  {1, 1, 1, 1, 0.792019601, 1, 1, -1, -1, -1, -1, -1, -0.792019601, -1}, 
  {-1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1}, 
  {-1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1}, 
  {-1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1}, 
  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 
  {0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558, 0.033558}
};
  1. Processing.org/reference/Array.html
  2. Docs.Oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
2 Likes