Revision fc7f1aba-27d6-4e13-be41-d0a932080cc2 - Code Golf Stack Exchange
#Math (non-competiting)
[![][1]][1]
(idk how to do LaTeX in PPCG, so I used a LaTeX to png tool)
## Explanation
The product of multiple circle equations (`(x-a)^2+(y-b)^2-r^2`) >= 0 will make a graph which this question needs. In the equation, `n` is the size of the array, and `(x, y or r)_k` is the `k`th `(x, y, or r)` element.
## Example
`(0,0,2),(2,2,2)`
[![(Thank you WolframAlpha)][2]][2]
(Inequality plot by WolframAlpha)
# Get/Run equation for WolframAlpha
> Getting script : Complete
<!-- begin snippet: js hide: true console: true babel: false -->
<!-- language: lang-html -->
<input id="in" placeholder="input, with () changed to []">
<br>
<input type="color" id="c1" value="#ff0000">
<input type="color" id="c2" value="#00ff00">
<br>
<input id="w" placeholder="width">
<input id="h" placeholder="height">
<br>
<button onclick="change()">
Convert!
</button>
<br>
<input id="res" placeholder="result">
<script>
function change() {
var a = document.getElementById("in").value;
document.getElementById("res").value = "";
var arr = JSON.parse("[" + a + "]");
document.getElementById("res").value += "plot ";
for (var i = 0; i < arr.length; i++) {
document.getElementById("res").value += "((x-"
document.getElementById("res").value += arr[i][1];
document.getElementById("res").value += ")^2+(y-";
document.getElementById("res").value += arr[i][2];
document.getElementById("res").value += ")^2-";
document.getElementById("res").value += arr[i][0];
document.getElementById("res").value += "^2)";
}
document.getElementById("res").value += ">=0";
document.getElementById("res").value += " from x=-";
document.getElementById("res").value += document.getElementById("w").value/2;
document.getElementById("res").value += " to x=";
document.getElementById("res").value += document.getElementById("w").value/2;
document.getElementById("res").value += " and y=-";
document.getElementById("res").value += document.getElementById("h").value/2;
document.getElementById("res").value += " to y=";
document.getElementById("res").value += document.getElementById("h").value/2;
document.getElementById("res").value += "> color ";
document.getElementById("res").value += document.getElementById("c1").value;
document.getElementById("res").value += " background color ";
document.getElementById("res").value += document.getElementById("c2").value;
}
</script>
<!-- end snippet -->
> Running script : Not done yet
_Uh oh, It looks like I broke WolframAlpha._
[1]: https://i.sstatic.net/IXSBG.png
[2]: https://i.sstatic.net/Ev0ZK.gif