Curve between two points and a tangent curve

Hi
I’m trying to achieve the following. Given ANY two points, draw a curve that starts/ends on those points, and that is tangent to a defined circle.
Here’s the example: on Rhino, but I can’t figure it out on Grasshopper.

Thanks in advance!

Try this

1 Like

Nice, that’s exactly what I need. Thanks a lot!

How about this case - I struggle to have ideas:
image

I want the black arc to use the start and end points of the purple curve, and have one tangent with the orange.

In Rhino tangent to 3 curves find the arc quickly but in Grasshopper don’t work

Thanks a lot for responding. And yes, that’s the problem I’m finding. It’s easy in Rhino, but I can’t find a solution in Grasshopper.

But I have 1116 curve pairs of orange and purple :joy:

This is something developers should do, you can submit a request

Hello
here is an ugly approximation using geometric solving.
The idea is to make some arc using start point of purple curve and points on green curve. Then make a circle with the arc, then measure distance from end point of purple curve and circle. Then draw the distance function and find the point that is near 0.

arc curve from 2 points and a line.gh (15.2 KB)

This problem is just a second order problem. So the end equation is like ax²+bx+c=0. But I am a bit lazy.

1 Like

This is a way using arc SED

circleTangent.gh (11.6 KB)

1 Like

We can do an intersection between a parabola and a line. … hinting that this problem should resolve with almost always 2 solutions (while purple and orange are not parallel):
arc from tangents and ends
Edit/
The starting information are 3 elements: 2 points (ends of purple) and a line (orange).
The final arc(s) center(s) is at the same distance from either of those 3 elements.
The red line is the bisector of purple, which is the graph of all possible centers between the two points.
The parabola is the graph of all possible centers, equi-distant from one of the points and the line.
Intersecting the two graphs, the line and the parabola, is the same as solving a math system.
We could also work with 2 parabolas, intersecting them, no line involved, same result. More cpu expensive though…
Probably the pure-math solution is just a dozens of rows of code… but solving like this with grasshopper is simpler :stuck_out_tongue_winking_eye:
/edit

Attached solution only keeps the smallest arc:

arc from tangent and ends.gh (15.3 KB)

6 Likes

:heart:

I’m so stunned by all this help - thank you guys so so much!

@maje90 your solution is just perfect. I would never have thought of the parabola. Super beautiful :sparkles:

Geometric solution

4 Likes

Another geometric solution, we can also use it to find the algebraic solution

find tang v3.gh (15.1 KB)

1 Like