# SegmentDistance(SegmentGeometry, PhysicsTransform, SegmentGeometry, PhysicsTransform)

> Calculate the distance and closest points between two segments.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.LowLevelPhysics2D](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public static PhysicsQuery.SegmentDistanceResult SegmentDistance(SegmentGeometry geometryA, PhysicsTransform transformA, SegmentGeometry geometryB, PhysicsTransform transformB)
```

### Parameters

**** (\[SegmentGeometry]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/segmentgeometry)): The first geometry to use.**** (\[PhysicsTransform]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicstransform)): The transform used to specify where the first geometry is positioned.**** (\[SegmentGeometry]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/segmentgeometry)): The second geometry to use.**** (\[PhysicsTransform]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicstransform)): The transform used to specify where the second geometry is positioned.

### Returns

| Type                                                                                                                         | Description                   |
| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| [SegmentDistanceResult](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/segmentdistanceresult.md) | The segment distance results. |
