Files
I150/srcs/RobotNet10/Commons/RobotNet10.GlobalPathPlanner/Model/GlobalNode.cs
2026-07-03 16:37:12 +07:00

20 lines
616 B
C#

namespace RobotNet10.GlobalPathPlanner.Model;
public class GlobalNode
{
public Guid Id { get; set; }
public Guid MapId { get; set; }
public string? Name { get; set; }
public double X { get; set; }
public double Y { get; set; }
public Orientation Orientation { get; set; }
public override string ToString() => Name ?? typeof(GlobalNode).ToString();
// Tính khoảng cách giữa 2 điểm
public double DistanceTo(GlobalNode other)
{
double dx = X - other.X;
double dy = Y - other.Y;
return Math.Sqrt(dx * dx + dy * dy);
}
}