# How to calculate spacetime intervals on a spacetime diagram?

In SR, the spacetime interval is given by the metric:

$ds^2=-dt^2+dx^2$ (where I set $c=1$).

To calculate $ds^2$ of a worldline on a spacetime diagram, I measure $dt$ and $dx$ of the line of interest, and plug in the above equation.

But in his answer to this question, user Marek calculated the spacetime interval of the green line as $ds_2^2 = -20^2 + 10^2 = -300$.

This confuses me, because I thought $ds^2_2=-150$. Because to calculate the length of the green curve I have to calculate the length of one part of it and then multiply it by 2, since the two green lengths are equal. By counting from the grid, $dt=10$ and $dx=5$, hence $ds_2^2 =2*(-(10)^2+(5)^2)=-150$.

So is my understanding of how to compute $ds^2$ mistaken or is it just a small mistake from Marek?

Marek didn't really make a mistake, but you did. But Marek might have been unclear by jumping over some steps. So first let's clarify. The metric gives the differential squared interval $ds^2=-dt^2+dx^2$ from which you can get the differential proper time $d\tau=\sqrt{dt^2-dx^2}.$
So for the blue straight line you have $\tau$=$\int d\tau$=$\int\sqrt{dt^2-dx^2}$=$\int dt=20.$ And for any straight line $\int\sqrt{dt^2-dx^2}$=$\sqrt{(\Delta t)^2-(\Delta x)^2}.$
For the green curve it makes up two straight lines A and B so $\tau$=$\int d\tau$=$\int\sqrt{dt^2-dx^2}$=$\int_A\sqrt{dt^2-dx^2}+ \int_B\sqrt{dt^2-dx^2}$=$\sqrt{10^2-5^2}+\sqrt{10^2-5^2}$=$2\sqrt{75}$=$\sqrt{300}.$
So you don't want to add up two square intervals. The metric is just for differential intervals. And you want to add up actual metric lengths (not squared lengths) to get the total length of a curve. For straight lines $\int\sqrt{dt^2-dx^2}$=$\sqrt{(\Delta t)^2-(\Delta x)^2}$ so you might become confused. But it is just like computing the length of a curve in any geometry. You break the curve into pieces find the piece of each one and add them up. That turns into an integral and the really small pieces eventually can be approximated by straight lines and those are easy to compute, so easy to compute that people might not bother mentioning the integral when they gave a straight line.