+++ /dev/null
-// -*- C -*-
-
-function dist(a,b) =
-#define dsq(i) (a[i]-b[i])*(a[i]-b[i])
- sqrt(dsq(0) + dsq(1));
-#undef dsq
-
-function circle_point(c, r, alpha) = [ c[0] + r * cos(alpha),
- c[1] + r * sin(alpha) ];
-
-function tangent_intersect(a,c,r) =
-#define d (dist(a,c))
-#define alpha (atan2(a[1]-c[1],a[0]-c[0]))
-#define gamma (asin(r / d))
-#define beta (alpha + 90 - gamma)
- circle_point(c, r, beta);
-#undef d
-#undef alpha
-#undef gamma
-#undef beta