It was proved by Shen that the graph of the classical Weierstrass function $\sum_{n=0}^\infty \lambda^n \cos (2\pi b^n x)$ has Hausdorff dimension $2+\log \lambda/\log b$, for every integer $b\geq 2$ and every $\lambda\in (1/b,1)$ [Hausdorff dimension of the graph of the classical Weierstrass functions, Math. Z., 289 (2018), 223–266]. In this paper, we prove that the dimension formula holds for every integer $b\geq 3$ and every $\lambda\in (1/b,1)$ if we replace the function $\cos$ by $\sin$ in the definition of Weierstrass function. A class of more general functions are also discussed.