  A class of optimal three-weight cyclic codes of dimension 3 over any finite
field was presented by Vega [Finite Fields Appl., 42 (2016) 23-38]. Shortly
thereafter, Heng and Yue [IEEE Trans. Inf. Theory, 62(8) (2016) 4501-4513]
generalized this result by presenting several classes of cyclic codes with
either optimal three weights or a few weights. Here we present a new class of
optimal three-weight cyclic codes of length $q+1$ and dimension 3 over any
finite field $F_q$, and show that the nonzero weights are $q-1$, $q$, and
$q+1$. We then study the dual codes in this new class, and show that they are
also optimal cyclic codes of length $q+1$, dimension $q-2$, and minimum Hamming
distance $4$. Lastly, as an application of the Krawtchouck polynomials, we
obtain the weight distribution of the dual codes.
