Hey, I want to convert the output of the Root function to coordinate in the form {{2,0}{-2,0}}, because I want to view them in the LocatorPane. Thats the code i wrote so far:
zero1 = x /. {ToRules[Roots[x^2 - 4 == 0, x]]};
xval[k_] := zero1[[k]]
yval = 0
Join[{Do[List[xval[b], yval], {b, Exponent[x^2, x]}]}]
But if I evaluate it I just get {{0,0},{0,0}} as a result. The code should work for every polynomial function thats why I use the Do function
In the case of a polynomial with degree 2 the code
Join[{List[xval[1], yval]}, {List[xval[2], yval]}]
works. I just cant find the mistake I made or don't know how to solve in in mathematica.