# GetRelativeMatrix(Transform, Transform, TransformPlane, bool)

> Get the relative transformation matrix between the two specified transforms using the specified transform plane.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public static Matrix4x4 GetRelativeMatrix(Transform transformFrom, Transform transformTo, PhysicsWorld.TransformPlane transformPlane = TransformPlane.XY, bool useScale = true)
```

### Parameters

**** (\[Transform]\(/engine/6000.7/script-reference/unityengine/transform)): The transform used as a reference to transform from.**** (\[Transform]\(/engine/6000.7/script-reference/unityengine/transform)): The transform used as a reference to transform to.**** (\[TransformPlane]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/transformplane)): The transform plane to use.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If the returned matrix should include scale.

### Returns

| Type                                                                  | Description                                    |
| --------------------------------------------------------------------- | ---------------------------------------------- |
| [Matrix4x4](/engine/6000.7/script-reference/unityengine/matrix4x4.md) | The calculated relative transformation matrix. |

### Remarks

For a custom transform plane use [PhysicsMath.GetRelativeMatrix2D](/engine/6000.7/script-reference/unity/u2d/physics/physicsmath/getrelativematrix2d.md) with each transform's local-to-world matrix instead.
