I am struggling with the shape function of finite element method. For sake of computation, most often we work with local coordinate. For 1d things are bit clear to me. but for 2d things getting hard to understand. Like what will be the best way to get $N_{1}^{[e]},N_{2}^{[e]}$ and $N_{3}^{[e]}$ for three node 2d triangular element?
$$ \begin{align} N^{[e]}_1&=\frac12 (\xi+\eta)\\ N^{[e]}_2 &= \frac12 (1+\xi)\tag1\\ N^{[e]}_3 &= \frac12 (1+\eta) \end{align} $$
For four node 2d rectangle it's easy to understand the $\xi-\eta$ system,
But I didn't get how they manage to get $N^{[e]}_i$ for $(1)$. Because I feel confused how to pick the $\xi-\eta$ system for triangle.
Didn't give me same $N^{[e]}_i$.
And for the integration we also need the variable transformation and Jacobian,
$$ \begin{align} x&=\sum x_i N^{[e]}_i\\ y&=\sum y_i N^{[e]}_i\\ J&=\left|\matrix{\frac{\partial x}{\partial \xi} & \frac{\partial y}{\partial \xi}\\\frac{\partial x}{\partial \eta} & \frac{\partial y}{\partial \eta}}\right| \end{align} $$
Which seems also painful if the nodes are increasing.
I didn't find any resource where shape function was described details for three and four node 2d triangle and rectangle element respectively. It will be a great help if anyone help me to figure out this. TIA.

