IMO leg yield should NOT be used to prepare for half-pass, unless it is simply for teaching a novice rider on an established school horse. Leg yield on a straight line is not an exercise I advocate much if at all, and I see little relation to the development of collection and engagement that half pass requires.
ETA: Nomiomi, it might help you to read the requirements for leg yield and half pass, as they are VERY different with regard to bend, positioning, engagement, etc. VERY different!
Also, not to be nitpicky but the first photo you posted is from a highly questionable site... a brief perusal is enough to have nearly any dressage trainer reaching for the bloodpressure meds. I certainly wouldn't recommend it for exemplary dressage pictures.
Half pass position relative to the long wall is the same as shoulder-in. Come round the corner, get shoulder in positioning then look across the diagonal and without altering the horse's position relative to the long side, change the direction of travel to be going straight along the line the horse is looking - haunches-in on the diagonal as someone said.
I do a stair step exercise sometimes - shoulder in on the long side for a couple of steps, then half-pass for a few steps, then shoulder in on the 1/4, then half pass to the centre line and shoulder in on the center line, then half-pass to the 3/4 line, shoulder-in on the 3/4 line, half-pass to far side, shoulder out along the wall and then straighten the horse and proceed. The position of the horse relative to the long sides doesn't change. The degree of bend doesn't change. Only the direction changes.
If you can ride a good travers on the wall, can you ride a good travers on the 1/4 line? For me it's the image of keeping the horse really pushed up against the outside rein from the inside leg (I picture them like a banana around my inside leg) If you can do this consistently, shoulder in, travers and half pass are the same thing in different positions. My coach always tells me to picture the wall beside me on the diagional and the halfpass is simply travers on that diagional line. Picturing the wall helps me really use the inside leg, keeps the horse up into the ouside rein and maintains the correct bend. If you can't ride that line like it's a wall, everything will be messy ime.