Revision history [back]

Beginner question: How to get y value given x in an equation?

Hi, I have an equation like so (I put in some simplifying values for the constants):

var('h1 h2 x y n')
n = 4/3
h1 = 1
h2 = 1
g = sqrt(x^2 + y^2) + n * sqrt(x^2 + (h1 + h2 - y)^2) - (h1 + n * h2) == 0


I am able to get a beautiful implicit plot:

graph = implicit_plot(g, (x, -0.5, 0.5), (y, 0, 2.5))
show(graph)


But how do I find out the numerical values at say x = 0.2? This doesn't give numerical values (and I don't really understand its result either):

solve(g(x=0.2), y)


It gives

[sqrt(y^2 - 4*y + 101/25) == -3/4*sqrt(y^2 + 1/25) + 7/4]


Thanks