namespace RobotNet10.GlobalPathPlanner.Model; /// /// Represents a node in the KD-Tree structure. /// Immutable to prevent structural corruption. /// /// /// Initializes a new KD-Tree node. /// public class KDTreeNode(GlobalNode node, int axis, KDTreeNode? left = null, KDTreeNode? right = null) { /// /// The spatial node stored at this tree node. /// public GlobalNode Node { get; } = node ?? throw new ArgumentNullException(nameof(node)); /// /// Left child (contains points with smaller values along the split axis). /// public KDTreeNode? Left { get; } = left; /// /// Right child (contains points with larger values along the split axis). /// public KDTreeNode? Right { get; } = right; /// /// The axis used for splitting: 0 for X, 1 for Y. /// public int Axis { get; } = axis; }