# IntersectsSegment(Rect, Vector2, Vector2)

> Check if a line segment overlaps a rectangle.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Experimental.GraphView](/engine/6000.5/script-reference/unityeditor/experimental/graphview.md)
* **Assembly:** UnityEditor

```csharp
public static bool IntersectsSegment(Rect rect, Vector2 p1, Vector2 p2)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Rectangle to check.**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): Line segment point 1.**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): Line segment point 2.

### Returns

| Type                                                          | Description                                               |
| ------------------------------------------------------------- | --------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if line segment overlaps rectangle. False otherwise. |
