This repository has been archived on 2020-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
ml/knn/KNN.py
2020-02-23 22:14:06 +08:00

14 lines
250 B
Python
Executable File

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import math
def computeEuclideanDistance(x1, y1, x2, y2):
d = math.sqrt(math.pow((x1 - x2), 2) + math.pow((y1 - y2), 2))
return d
d_ag = computeEuclideanDistance(3, 104, 18, 90)
print(d_ag)