Let say that I have path that goes through 4 vertices. When doing rapid prototyping I would define this in java as
double[][] path = {{1.0, 2.0}, {1.0,3.0}, {3.0,4.0}, {8.0,9.0}}
Using the arrayOf, and doubleArrayOf function the same code in Kotlin would be
val path = arrayOf(doubleArrayOf(1.0, 2.0), doubleArrayOf(1.0, 2.0), doubleArrayOf(1.0,3.0), doubleArrayOf(8.0,9.0))
Which feels a bit verbose. Is there a Kotlin way of solving this ?
Edit: The use-case is answering queries in a "REPL like" environment on numerical data i.e. think Matlab or SciPy.