In Act 1, sc. 3, Polonius instructs Ophelia to stay away from Hamlet for fear that Hamlet will merely use Ophelia, then toss her aside thus embarrassing Polonius and the family. Ophelia does as her father says which explains the scene that Ophelia describes to her father from Act 2, sc. 1 in which she tells of a distraught Hamlet coming to her room. That is all set up for Act 3, sc. 1, where Hamlet does treat Ophelia badly. She returns letters to him that he had written to her and this seems to set him off on his tirade against her and against women in general. He seems to know, too, that Polonius is spying on him and when he asks Ophelia where her father is, she responds, "At home, my lord," which makes Hamlet even more angry. His anger toward her is an anger more out of frustration than from anything Ophelia did. He is frustrated with his mother, he is frustrated that Ophelia stopped seeing him with apparently little or no explanation, and he is frustrated with himself for not having done as his father's ghost asked him to do (kill Claudius). In scene 2 of Act 3, when the players are performing the play, Hamlet is once again cruel in his words to Ophelia. Again, he is more frustrated than angry. His words are for women in general so that many of his insults include his mother. At a time when he could have really used a comforting, understanding woman in his life, he has none and that causes him to be bitter and angry.