Cyclic codes are an important subclass of linear codes.They are widely used in data storage systems and communication systems,because they have clear algebraic structure,simple encoding and decoding algorithms,and easy implementation.In this paper,a class of ternary cyclic codes is studied.By analyzing the solutions of some equations,the parameters of such ternary cyclic codes are determined.The optimality of the codes is proved by the Sphere Packing bound.