namespace NeonSprawl.Server.Game.World;
///
/// Horizontal (floor-plane) distance on X/Z only; Y is ignored for reach (NS-18).
///
public static class HorizontalReach
{
/// Planar distance sqrt(dx² + dz²) using only X and Z.
public static double HorizontalDistance(double ax, double az, double bx, double bz)
{
var dx = ax - bx;
var dz = az - bz;
return Math.Sqrt((dx * dx) + (dz * dz));
}
/// true when <= radius (boundary inclusive).
/// is negative (invalid configuration).
public static bool IsWithinHorizontalRadius(double ax, double az, double bx, double bz, double radius)
{
ArgumentOutOfRangeException.ThrowIfNegative(radius);
return HorizontalDistance(ax, az, bx, bz) <= radius;
}
}