Пример #1
0
bool Intersections::CircleVsPointIntersection(const Vector2<float>& aCirclePosition, const float& aCircleRadius, const Vector2<float>& aPointPosition)
{
	Vector2<float> differenceVector = aCirclePosition-aPointPosition;
	return differenceVector.Length2() <= aCircleRadius*aCircleRadius;
}
Пример #2
0
bool Intersections::CircleVsCircleIntersection(const Vector2<float>& aFirstCirclePosition, const float& aFirstCircleRadius, const Vector2<float>& aSecondCirclePosition, const float& aSecondCircleRadius)
{
	Vector2<float> differenceVector = aFirstCirclePosition-aSecondCirclePosition;
	float totalRadius = aFirstCircleRadius+aSecondCircleRadius;
	return differenceVector.Length2() <= totalRadius*totalRadius;
}