如何画一条与线平行且与圆相切的线?

如何画一条与线平行且与圆相切的线?

假设渐近线中有一条直线,并且有一个圆。如何画一条与给定直线平行的圆的切线?

答案1

我绝不是 Asymptote 的专家,因此可能有更优雅的方法来做到这一点,但这里有一个可能的解决方案:

在此处输入图片描述

\documentclass[border=5mm]{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
size(233, 144);
pair a = (-20, 80);
pair b = (100, 42);
path c = scale(50) * unitcircle;
draw(a .. b); draw(c);
real t = dirtime(c, a-b);
draw(shift(point(c, t)) * shift(-0.5a - 0.5b) * (a..b), red);
\end{asy}
\end{document}

我把它放在一个名为的文件中t.asy,并用它编译

lualatex t && asy t-1 && lualatex t

(YMMV 取决于您的设置...)

答案2

这是我针对实际问题所做的。

settings.outformat = "png";
defaultpen(fontsize(14pt));
import geometry;

size(16cm);

pair a = (0, 1.5);
pair b = (-1, 0);
pair c = (1, 0);

show(triangle(a,b,c), La="", Lb="", Lc="", 0.7*green);
circle i = incircle(triangle(a,b,c));
draw(i, 0.5*green+0.8*blue);
pair c1[] = intersectionpoints(i, line(a, b));
line p1 = perpendicular(c1[0], line(a,b));
pair c2[] = intersectionpoints(i, p1);
line t1 = tangent(i, c2[0]);
pair p2 = intersectionpoint(t1, line(b, c));
pair p3 = intersectionpoint(t1, line(a, c));
draw(p2 -- p3, 0.7*green);
pair c1[] = intersectionpoints(i, line(b, c));
line p1 = perpendicular(c1[0], line(b,c));
pair c2[] = intersectionpoints(i, p1);
line t1 = tangent(i, c2[1]);
pair p2 = intersectionpoint(t1, line(a, b));
pair p3 = intersectionpoint(t1, line(a, c));
draw(p2 -- p3, 0.7*green);
pair c1[] = intersectionpoints(i, line(a, c));
line p1 = perpendicular(c1[0], line(a,c));
pair c2[] = intersectionpoints(i, p1);
line t1 = tangent(i, c2[0]);
pair p2 = intersectionpoint(t1, line(a, b));
pair p3 = intersectionpoint(t1, line(b, c));
draw(p2 -- p3, 0.7*green);

给出下图。

在此处输入图片描述

答案3

与圆相切:给定方向

除了 Thurston 的答案之外,还有一个渐近线解决方案。我第一次了解到圆的length(或) 是。time4

在此处输入图片描述

// tangent to a circle: with given direction
// http://asymptote.ualberta.ca/
unitsize(1cm); 
pair A=(-1,4), B=(5,1.5); 
path cir=scale(2.5)*unitcircle; 
real t=dirtime(cir,A-B); 
write("The length of any circle is ",length(cir));
pair M = point(cir,t);  
pair P = point(cir,t+length(cir)/2);  
draw(A--B,blue);  
draw(cir); 
draw(M+.4(A-B)--M-.5(A-B), red);
draw(P+.4(A-B)--P-.5(A-B), red);
dot("$M$",align=NE,M,red); 
dot("$P$",align=SW,P,red); 
dot("$A$",align=W,A,blue); 
dot("$B$",align=E,B,blue);

相关内容