// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Ellipse border length estimate // Not compiled or tested in-world // Setup: Place in a spare prim. Set positive semi-axes A and B. Owner touch prints results without altering the scene. // Stop / restore: Disable or remove. No prim properties are changed. // Notes: The result is approximate, especially for extremely flat ellipses. Semi-axes are half the overall width and height. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Owner-only calculation. float A=5.0; float B=3.0; default { touch_start(integer detectedCount) { if (llDetectedKey(0)!=llGetOwner()) return; if(A<=0.0||B<=0.0) { llOwnerSay("Positive semi-axes required."); return; } float h=((A-B)*(A-B))/((A+B)*(A+B)); float perimeter=PI*(A+B)*(1.0+3.0*h/(10.0+llSqrt(4.0-3.0*h))); llOwnerSay("Approximate ellipse perimeter="+(string)perimeter); } }