In this paper, the consensus problem is investigated for a distributed multiagent system (MAS), where the consensus is characterized by curvature function and torsion function. According to the Frenet-Serret formulas, a distributed consensus protocol is designed for the tangent, normal, and binormal unit vectors of trajectory of each agent, and then it gets a closed-loop system. Based on the Lyapunov function, several sufficient conditions for consensus are derived for the closed-loop system. Also the consensus problem of multiagent system on a surface is studied. Finally, the numerical examples show the reliability of the proposed methods.