我想将二维搜索空间中的某个点a移动到另一个点b,步长为(_config.StepSize = 0.03)。
Point a = agent.Location;
Point b = agentToMoveToward.Location;
//--- important
double diff = (b.X - a.X) + (b.Y - a.Y);
double euclideanNorm = Math.Sqrt(Math.Pow((b.X - a.X), 2) + Math.Pow((b.Y - a.Y), 2));
double offset = _config.StepSize * ( diff / euclideanNorm );
agent.NextLocation = new Point(a.X + offset, a.Y + offset);
//---
这是否正确?