I'm learning about the K-means model. I'm going to detect the anomalies using the k-means for that I need to calculate the distance between centers and point how should I do that.
You can just compute the Euclidean distance of any points within one cluster with respect to that cluster's centroid. For categorical variable, it is preferable to use distance as either 1 or 0 (means if 2 observations of same features are having same class then take distance for that feature as 1,else 0). To get the K-means cluster(assuming that you are using some language for clustering), K-means generally have a attribute like "cluster_centers_" (available in python)