const euclideanDistance = (a: Array<number>, b: Array<number>) =>
        Math.hypot(...Object.keys(a).map(key => b[key] - a[key]));
      
      Typescript language logo

      Euclidean Distance

      Codiga's TypeScript Recipes

      Calculates the distance between two points in any number of dimensions.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.