I’m trying to find a method of defining an ellipse. This can either be proceedural in grasshopper or mathematical but I can’t figure out either.

I can’t seem to upload an image so I’ll try and describe my problem.

I want an ellipse that has it’s major axis on the X axis with the furthest point being at a known location (x1,0). The ellipse must pass through two other points with known gradients which are mirrored in the X-axis.

Now, I need to find the major and minor axis values (a and b) and also the centre of the ellipse (x0,y0). I have the two points (x2,y2) and (x2,-y2) and their gradient vectors. To me there is a single solution which should be definable using either maths for geometry, but I can’t figure it out.

The trouble is, the two contract points, which are mirrored, have a specific location and gradient. I think (with out testing) that your method gives a non- specific contact point.

Thank you very much for your replies. I’ve looked at them all and I think we’re getting there.

So. It’s my fault and I should have been clearer. The centre of the ellipse (P0) is not set, or at least x0 is an unknown. The knowns are P1, P2 and P3 as well as the tangent at p2 and P3.

From your last two examples it is clear that a range of tangents are available at P2 and P3 if the centre (P0) is free to move. What I desperately need is a way to find the centre etc while keeping to the other contraints. I think it’s possible as you’ve demonstrated it.

I’ve been trying this one today, and thought of your script.
I don’t think it applies to Mark, since he wants an ellipse from 3 points, and with specific tangents to each. Not easy!

I have ended up brute-forcing the solution (see below), but it’s only approximate, and super ugly.
Still thinking about this one…

That’s great. I’ll test it here. Could I ask a favour and could you put the python inside of a .gh file? I’m unable to download the python onto my work network.