Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
namespace RobotNet10.Common.Models;
/// <summary>
/// Represents a node in the KD-Tree structure.
/// Immutable to prevent structural corruption.
/// </summary>
/// <remarks>
/// Initializes a new KD-Tree node.
/// </remarks>
public class KDTreeNode(KDTreeData node, int axis, KDTreeNode? left = null, KDTreeNode? right = null)
{
/// <summary>
/// The spatial node stored at this tree node.
/// </summary>
public KDTreeData Node { get; } = node ?? throw new ArgumentNullException(nameof(node));
/// <summary>
/// Left child (contains points with smaller values along the split axis).
/// </summary>
public KDTreeNode? Left { get; } = left;
/// <summary>
/// Right child (contains points with larger values along the split axis).
/// </summary>
public KDTreeNode? Right { get; } = right;
/// <summary>
/// The axis used for splitting: 0 for X, 1 for Y.
/// </summary>
public int Axis { get; } = axis;
}
public record KDTreeData(string Id, double X, double Y);