So I have not actually tested these but based on my research these should be correct I think.

```
public static float3 getScale(in float4x4 matrix)
{
return new float3(math.length(matrix.c0.xyz), math.length(matrix.c1.xyz), math.length(matrix.c2.xyz));
}
public static float3 transformPoint(in LocalToWorld w, in float3 pos)
{
return math.transform(w.Value, pos);
}
public static float3 inverseTransformPoint(in LocalToWorld w, in float3 pos)
{
return math.transform(math.inverse(w.Value), pos);
}
public static float3 transformDirection(in LocalToWorld w, in float3 dir)
{
return math.transform(float4x4.TRS(float3.zero, Unity.Physics.Math.DecomposeRigidBodyOrientation(in w.Value), new float3(1.0F, 1.0F, 1.0F)), dir);
}
public static float3 inverseTransformDirection(in LocalToWorld w, in float3 dir)
{
return math.transform(math.inverse(float4x4.TRS(float3.zero, Unity.Physics.Math.DecomposeRigidBodyOrientation(in w.Value), new float3(1.0F, 1.0F, 1.0F))), dir);
}
public static float3 transformVector(in LocalToWorld w, in float3 vec)
{
return math.transform(float4x4.TRS(float3.zero, Unity.Physics.Math.DecomposeRigidBodyOrientation(in w.Value), getScale(in w.Value)), vec);
}
public static float3 inversetransformVector(in LocalToWorld w, in float3 vec)
{
return math.transform(math.inverse(float4x4.TRS(float3.zero, Unity.Physics.Math.DecomposeRigidBodyOrientation(in w.Value), getScale(in w.Value))), vec);
}
```