- Home /

# What does bounds.sqrdistance do?

I've read the unity manual on bounds.sqrdistance and I'm confused. It says "The smallest squared distance between the point and this bounding box." Can anyone help to explain this a little bit more clearly?

Thanks

**Answer** by dan_wipf
·
Jan 18, 2019 at 07:35 AM

Ok *Bounds.SqrDistance(Vector 3 point)* is equal for example to this:

```
float SmallestDistance = Vector3.Distance(Vector3_Point,GetComponent<Renderer>().bounds.ClosestPoint(Vector3_Point));
float BoundsSqrDistance = SmallestDistance * SmallestDistance;
```

so to be clear. *Bounds.SqrDistance(Vector3 point)* does makes a new Square between the closest Point of a Boundary Box and a given Vector3 point and as Result you get a Distance² float between the closest Point of a BB and a given Vector3 point.

So you could break it down to get the actual distance, if you'd do a Square Root * √ * Mathf function like this:

```
float acutal distance = Mathf.Sqrt(GetComponent<Renderer>().Bounds.SqrDistance(point);
```

Let me know if this is the kind of Wisdom you've searched for.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

How to limit mousePosition based on distance (2D) 2 Answers

How do I get the square root of a double number value? 2 Answers

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Unity C#: removing special characters from a string 1 Answer