Distance function that captures both circular and "appear as line" clusters based on what I know in k-mean clustering, if i use single linkage distance it can capture clusters of thread shapes but it is not suitable for capturing circular clusters.
Also If we use complete linkage for example it is suitable for capturing circular clusters but not "thread-like" clusters.
Is there any other method or distance function that can capture both circular and "appear as line" clusters?

DBSCAN is a density-based clustering algorithm, which works on how close neighboring data points are together, rather than with how far away each point is from a set of fixed points (the cluster centers in k-means). It should be available in your computing software of choice.
