# How to draw a double empty ASCII rhombus?

How to draw a double empty rhombus with asterisks? I have implemented the rhombus itself, but I don’t understand how to make it double.

*          *
* *        * *
*   *      *   *
*     *    *     *
*       *  *       *
*         **         *
*       *  *       *
*     *    *     *
*   *      *   *
* *        * *
*          *

My code:

int i, j, n = 6;
String str = "";
for (i = 1; i <= n; i++) {
for (j = n; j > i; j--)
str += " ";
str += "*";
for (j = 1; j < (i - 1) * 2; j++)
str += " ";
if (i == 1)
str += ("n");
else
str += ("*n");
}
for (i = 2; i <= n; i++) {
for (j = 1; j < i; j++)
str += " ";
for (j = 1; j <= n * 2 - (2 * i - 1); j++)
if (i == 0 || j == 1 || j == n * 2 - (2 * i - 1))
str += "*";
else
str += " ";
str += "n";
}
System.out.println(str);

Imagine a coordinate plane and draw a graph of the function in a rhombus form:

Math.abs(y - n) + Math.abs(x - n) == n

Try it online!

The zero point is in the upper left corner, and axes are directed downward and to the right:

// size of the rhombus
int n = 6;
// number of rhombuses
int m = 4;
// vertical axis
for (int y = 0; y <= 2 * n; y++) {
// horizontal axis
for (int x = 0; x < 2 * n * m + m; x++) {
// current rhombus
int k = x / (2 * n + 1);
// center of the rhombus
int c = (2 * k + 1) * n + k;
// check if this point is on the rhombus
if (Math.abs(y - n) + Math.abs(x - c) == n)
System.out.print("*");
else
System.out.print(" ");
}
System.out.println();
}

Output:

*            *            *            *
* *          * *          * *          * *
*   *        *   *        *   *        *   *
*     *      *     *      *     *      *     *
*       *    *       *    *       *    *       *
*         *  *         *  *         *  *         *
*           **           **           **           *
*         *  *         *  *         *  *         *
*       *    *       *    *       *    *       *
*     *      *     *      *     *      *     *
*   *        *   *        *   *        *   *
* *          * *          * *          * *
*            *            *            *