On the tennis court there are times when frustration brings players to do stupid things and letting your temper get the best of your can be costly. First off it has the effect of giving your opponent the pleasure of seeing you break mentally and often this makes them mentally stronger.
Additionally, there are rules against this in tournament play especially when it impacts safety which often by accident it can and does. Here is an example.
Time Henman Hits a ball girl at Wimbledon when he loses his temper and smacks a ball that was not in play, but rather in his possession and is disqualified.
He's lucky he didn't hit her in the eye and blind her but an ear hit at close range is definitely not pleasurable and could even damage hearing.
Another aspect of this is ego, that big EGO that many of us have witnessed when a player full of themselves needs to impress the audience however small that losing or not playing a single point well justifies acting out. Often, the player talks to themselves loudly so the audience can hear as they provide excuses for not being the masterful player they fantasize themselves to be and want everyone to know that it is beneath them to be in this situation. I've witnessed this enough times and it is embarrassing to be a witness to such folly.
Do yourself a favor and find a way to contain your rage and anger over mistakes or perceived injustices on the court. It can cost you a match and more importantly cause you to lose enjoyment of the game and will surely do so to your partner if playing doubles. Your opponents often gain from poor behavior on your part.