[![Code result of graph](https://i.stack.imgur.com/fW42T.png)](https://i.stack.imgur.com/fW42T.png)

I'm trying to create a simple code in R that will graph a parabola.

In the graph there will be a parapola and two point marking where it goes through the X axis.
The firdt point (x1) is drawn great but the second point (x2) is drawn... at the same place as x1 despite being negitive at these values.

any help in understanding why this is happening and how to correct it?

```
a=1
b=0
c=-5
curve(a*(x^2)+b*x+c, ylim=c(-10,10), xlim=c(-10,10))
abline(h=0, v=0, lwd=2)
grid()

## Add points at axises
x1<-(-b+sqrt(b^2-4*a*c))/(2*a)
if(!is.nan(x1)){
  p1 <- c(x1, a*(x1^2)+b*x1+c)
  points(t(p1), pch=16)
  text(t(p1), "x1", adj=-1)
}
if(!is.nan(x2)){
  x2<-(-b-sqrt(b^2-4*a*c))/(2*a)
  p2 <- c(x2, a*(x2^2)+b*x2+c)
  text(t(p2), "x2", adj=-1)
}

```