summaryrefslogtreecommitdiff
path: root/info/drawing-with-metapost/src/tangent-times.mp
blob: ecbb62bb97d06afbdc726d4d9bbadb8613b99099 (plain)
1
2
3
4
5
6
7
8
9
10
11
vardef tangent_times(expr C, p) = 
    save m, a, b, G, H;
    pair m; numeric a, b; path G, H;
    m = 1/2[p, center C];
    H = halfcircle scaled abs (p - center C)
        rotated angle (p - center C) shifted m;
    G = H rotatedabout(m, 180);
    (a, whatever) = C intersectiontimes H;
    (b, whatever) = C intersectiontimes G;
    (a, b if b < a: + 8 fi)
enddef;