The slope is 1/2 throughout the entire line.
Looking at the first triangle, the rise is 2 and the run is 4. That gives us a slope of 2/4 = 1/2.
For the second triangle, the rise is 1 and the slope is 2. This gives us a slope of 1/2.
Any linear function will have the same slope throughout the entire line.