# DistanceToCircle

> Returns the distance in pixels from the mouse pointer to a camera facing circle.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

## DistanceToCircle(Vector3, float)

Returns the distance in pixels from the mouse pointer to a camera facing circle.

```csharp
public static float DistanceToCircle(Vector3 position, float radius)
```

### Parameters

**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

Calculates the screen space distance from the mouse pointer to the circle at given world space position with the given radius. The circle is assumed to be facing the camera.

Uses the current camera to determine the distance.

Additional Resources: [HandleUtility.DistanceToDisc](/engine/6000.0/script-reference/unityeditor/handleutility/distancetodisc.md).

## DistanceToCircle(CameraProjectionCache, Vector3, float)

Returns the distance in pixels from the mouse pointer to a camera facing circle.

```csharp
public static float DistanceToCircle(CameraProjectionCache projection, Vector3 position, float radius)
```

### Parameters

**** (\[CameraProjectionCache]\(/engine/6000.0/script-reference/unityeditor/cameraprojectioncache)): **** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

Calculates the screen space distance from the mouse pointer to the circle at given world space position with the given radius. The circle is assumed to be facing the camera.

Uses the current camera to determine the distance.

Additional Resources: [HandleUtility.DistanceToDisc](/engine/6000.0/script-reference/unityeditor/handleutility/distancetodisc.md).
