/// <summary> /// Checks wether two BoundingCircles intersects each other. /// </summary> /// <param name="other">The other BoundingCircle, which hypothetically intersects with this one.</param> /// <returns>True if they intersect, false if not.</returns> public bool Intersects(Circle other) { if (SurrondingBox.Intersects(other.SurrondingBox)) { return(Radius + other.Radius >= Utils.DistanceBetweenPoints(CenterPosition, other.CenterPosition)); } else { return(false); } }
/// <summary> /// Checks wether a point is inside of the circle. /// </summary> /// <param name="point">The position which hypothetically is inside of the cirle.</param> /// <returns>True of the position is inside of the circle, false if not.</returns> public bool Contains(Vector2 point) { if (SurrondingBox.Contains(point)) { return(Radius >= Utils.DistanceBetweenPoints(CenterPosition, point)); } else { return(false); } }