# Tangential Circle through Point

![](/files/-MGi8U3hq9FX9mKONwwx)

```d
//Increase num for higher precision
//Will fail if too low and take too long if too high
num = 15;

//Centers of circles that are tangential and equidistant to the input Curves
pt1 = c1.PointAtParameter(0..1..#num);
pt2 = c2.PointAtParameter(0..1..#num);
pl1 = Plane.ByThreePoints(c1.CenterPoint,c1.CenterPoint.Translate(0,0,1),pt1);
vc1 = Vector.ByTwoPoints(c2.CenterPoint,pt2);
pt3 = Point.PruneDuplicates(List.Flatten(pt2.Project(pl1<1>,vc1<2>),-1),0.01);
ds1 = Math.Round(pt3<1>.DistanceTo(pt1<2>),1);
ds2 = Math.Round(pt3<1>.DistanceTo(pt2<2>),1);
pt4 = List.FilterByBoolMask(pt3,List.AllFalse((ds1==ds2)<1>))["out"];

//Centers that are equidistant to the input Curves and Point
ds3 = Math.Round(pt4<1>.DistanceTo(c1<2>),1);
ds4 = Math.Round(pt4<1>.DistanceTo(c2<2>),1);
ds5 = Math.Round(pt4<1>.DistanceTo(p1<2>),1);
pt5 = List.FilterByBoolMask(pt4,ds3==ds5 && ds4==ds5)["in"];
ds6 = pt5.DistanceTo(p1);
cr1 = Circle.ByCenterPointRadius(pt5,ds6);

//Geometry Color
[GeometryColor.ByGeometryColor(p1,Color.ByARGB(255,255,0,0)),
GeometryColor.ByGeometryColor(c1,Color.ByARGB(255,0,255,0)),
GeometryColor.ByGeometryColor(c2,Color.ByARGB(255,0,0,255)),
GeometryColor.ByGeometryColor(cr1[0],Color.ByARGB(255,255,0,255))];
```

{% file src="/files/-MGi8atfvLOnBQGa3\_32" %}

```d
//Curve 1
c1 = Arc.ByThreePoints(Point.ByCoordinates(-3,2),
Point.ByCoordinates(2,1),Point.ByCoordinates(5,3));

// Curve 2
c2 = Arc.ByThreePoints(Point.ByCoordinates(-6,2),
Point.ByCoordinates(-4,1),Point.ByCoordinates(0,3));

//Point
p1 = Point.ByCoordinates(-2,1);

//Limit length of arcs as much as possible
//Will fail if no circle passes through the point
//Multiple circles that satisfy the condition possible
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.testingwaters.in/geometry-1/tangential-circle-through-point.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
