The Distance
method calculates the Euclidean distance between the current Vector3Int
instance and another specified Vector3Int
instance. This method is useful for determining how far apart two points are in a 3D integer space.
The Distance
method calculates the Euclidean distance between the current Vector3Int
instance and another specified Vector3Int
instance. This method is useful for determining how far apart two points are in a 3D integer space.
To use the Distance
method, you need to have two Vector3Int
instances. Call the method on one instance and pass the other instance as a parameter. The method will return a float
representing the distance between the two vectors.
Vector3Int pointA = new Vector3Int(1, 2, 3); Vector3Int pointB = new Vector3Int(4, 5, 6); float distance = pointA.Distance(pointB); // distance will be approximately 5.196