This applet looks at combining two investments, A and B, in a portfolio where each investment has a rate of return and a risk factor, but one is risk free. (Typically T-bills ar considered risk free.)
Besides the investments we also have to give the weighting each is given in the portfolio.
We then compute the rate of return and the risk factor forC, the combined portfolio.
Changing the weight, w, moves C along the risk/return curve.
Changing the features of A and B moves the risk/return curve

The basic assumption is that portfolio C is achieved with w*A +(1+w)*B.
Then we assume , or the return for portfolio C is , or a weighted average of the rates of return on A and B.
If is the risk associated with B, then
Notice that changing w moves along the risk return curve, while changing the other parameters moves the curve.
When one investment is risk free, then the risk return curve is a line segment.