How do you get past the energy pellets in Test Chamber 19 in Portal?

Quick answer: Use the tilted panels to bounce the first pellet into its catcher, then redirect the later pellet with a portal near the ceiling and one where it hits the wall.
Show walkthrough
How pellets work
High Energy Pellets fly in a straight line and bounce off walls. They kill you if they touch you. Each puzzle wants the pellet in a catcher, which powers something.
First pellet
At the end of the first hallway, place portals on the tilted panels so the pellet bounces toward the catcher. If you cannot line it up, wait until the pellet sits beside the catcher. Then put a portal on the wall in front of you, under the emitter, to send it in.
Later pellet
Further on, put one portal near the ceiling at the end of the hall. Put the other on the wall where the pellet bounces. The pellet flies through and reaches its catcher.
Stay safe
Never stand between a pellet and a wall it is about to hit. Wait for a pellet to pass before you cross its line. If you die, the chamber reloads from the last checkpoint.
