How a hexagram changes
Only the moving lines switch between yin and yang to form the resulting hexagram.

There may be no moving lines or several. This service produces no resulting hexagram when none move. A resulting hexagram does not mean a fixed future.
Read about the three terms
Primary hexagram (本卦)
The seat of the moment the question was asked — the first hexagram cast.
The primary hexagram is the one erected first when a reading is cast, and it images the seat of the moment the question was asked. Its six lines are built from the bottom up: the lower three form the inner trigram, the upper three the outer. In reading it, one takes the image and the judgement of the whole hexagram first, then narrows to the line statement if there is a changing line. Convention treats the primary hexagram as a picture of where one now stands rather than an answer.
Changing line (動爻)
The place in a hexagram that is about to turn — its line statement becomes the focus.
A changing line is the place among the six that is about to turn. Whether cast with yarrow stalks or coins, a line that comes out old yang or old yin becomes a changing line, and flipping it yin↔yang yields the resulting hexagram. In reading, the changing line is the focus: if the whole hexagram is the situation, the changing line is the part currently in motion, so its line statement is taken as the centre of the answer. There may be no changing lines or several, and which one to centre on then follows rules that differ by lineage.
Resulting hexagram (之卦)
The hexagram formed by flipping the changing lines — where the current is heading.
The resulting hexagram is obtained by flipping the primary hexagram's changing lines yin↔yang, and it points at where the current is heading. If the primary hexagram is 'now', the resulting one is closer to 'the seat one comes to if things go on as they are'. ⚠️ Convention is not to read it as a settled future — the I Ching speaks of the direction that naturally follows from where one stands, not of fixed events, and how a person conducts themselves changes that grain. With no changing lines there is no resulting hexagram, and the reading rests on the primary image alone.
Source: traditional I Ching concepts of casting and changing lines. Lines are counted from the bottom.