// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Solve two coupled linear equations // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set coefficients for A*x+B*y=C and D*x+E*y=F. Touch to run; output is private to the owner. // Stop / restore: Disable/remove. No scene changes or external calls. // Notes: Small determinants indicate an unstable solution. Inputs are examples, not measurements of scene objects. // License: see LICENSE in this distribution. // Original Incoprea. MIT. float A=2.0; float B=1.0; float C=7.0; float D=1.0; float E=-1.0; float F=2.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; float determinant=A*E-B*D; if(llFabs(determinant)<0.000001) { llOwnerSay("No stable unique solution."); return; } float x=(C*E-B*F)/determinant; float y=(A*F-C*D)/determinant; llOwnerSay("x="+(string)x+" y="+(string)y); } }