In this paper, we deal with a consensus control problem for a group of high dimensional agents which are networked by digraphs. Assuming that the control input of each agent is constructed based on the weighted difference between its states and those of its neighbor agents, we aim to propose an algorithm on computing the weighting coefficients in the control input. The problem is reduced to designing Hurwitz polynomials with complex coefficients. Focusing on the case of three dimensional systems, we show that by using Hurwitz polynomials with complex coefficients, we obtain a necessary and sufficient condition for the consensus algorithm. The condition is a natural extension to second order consensus, and is reasonable and practical due to its comparatively less computation burden. Two numerical examples show effectiveness of the proposed condition and the consensus algorithm.