添加马哈顿距离判断
This commit is contained in:
parent
8303f98fe3
commit
51e1820242
@ -98,6 +98,12 @@ namespace a8
|
||||
return v.Norm();
|
||||
}
|
||||
|
||||
float Vec2::ManhattanDistance(const Vec2& b)
|
||||
{
|
||||
float distance = std::fabs(x - b.x) + std::fabs(y - b.y);
|
||||
return distance;
|
||||
}
|
||||
|
||||
Vec2 Vec2::Perp()
|
||||
{
|
||||
return Vec2(y, -x);
|
||||
|
Loading…
x
Reference in New Issue
Block a user