Answers for "c# get distance"

C#
1

c# get distance

//For Unity C#
float GetDistance(Vector2 posA, Vector2 posB) {
	float dx = posA.x - posB.x;
    float dy = posA.y - posB.y;
    float distance = Mathf.Sqrt(dx * dx + dy * dy);
    return distance;
}
Posted by: Guest on February-07-2021

Code answers related to "c# get distance"

C# Answers by Framework

Browse Popular Code Answers by Language