Suppose I have equation of curve C
:
curve
# => y^2 + (x^2 + x)*y + x
curve.parent()
# => Univariate Polynomial Ring in y over Rational function field in x over Rational Field
and I know that x
that is root of another equation:
equation
# => x^3 + x^2 - 2*x - 9/2
equation.parent()
# => Univariate Polynomial Ring in x over Rational Field
is x-coordinate of some point of C
.
How to properly get y-coordinate of C
in x
?
It is not as easy as it seems because of conversion problems.
My workaround is as following:
FF.<z> = NumberField(equation)
P.<x,y> = QQ[]
u = P(curve).subs(x=z)
P.<y> = FF[]
return z, P(u).roots()[0][0]
and it doesn't seem right.
Are there more elegant way of doing it?