Javascript based algorithm for finding a circle which passes through three points