This example demonstrates the use of the SCS WebAssembly version to solve a second-order cone program (SOCP) with a linear constraint and a second-order cone constraint. It computes the point \(x\) that is closest to the origin, subject to lying in the half-plane \(x_1 + x_2 \ge b\) and within a disc of radius \(r\) centered at \(c = (-2, 2.5)\). Here, the values of \(b\) and \(r\) are set by sliders. The solution is computed using two second-order cones, one for the disc constraint, and one to encode \(\|x\|_2 \leq d\), where \(d\) is the distance from the origin, which is the quantity to be minimized.
Loading...