I want to get a set of equispaced points in $[0,\pi/2]$ and use piecewise linear interpolation generated by those points to fit the sine function. And I want to determine how many points do I need to put in to generate the linear interpolation fit such that maximum error in that interval can be guaranteed not exceeding $10^{-4}$.
Theoritically, we have $|f(t)-l(t)|\leq\frac{h^2}{8}\max\limits_{0\leq c_t\leq\frac{\pi}{2}}|f''(c_t)|$. Using this, roughly estimating this by letting the max second derivative be 1, I would get the result that nearly 57 points are needed to divide the interval. But are there any better ways of estimating this?
You can get a better result by using non-uniform partitions. The goal is to partition $[0,\pi/2]$ by points $0=x_0<x_1<\dots<x_n=\pi/2$ such that $$ \frac18 (x_j-x_{j-1})^2 \sin x_j \le 10^{-4} $$ for all $j$. Here I'm using the fact that the maximum of $|\sin x|$ on a subinterval is attained at the right endpoint.
These points can be computed from right to left, starting with $x_n=\pi/2$ and using $$ x_{j-1}=x_j - \sqrt{8\cdot 10^{-4}/\sin x_j} $$ After $44$ steps the value turns out to be negative. Replacing that value by $0$, we get a partition with $44$ subintervals. The points $x_j$ are listed below.
I'm not saying this is a practical way to interpolate (uniform partition is much simpler and works just fine), but if you really want to reduce the number of points, this achieves something.