Well, there are lots of reasons why someone could feel irritable and agitated. Being under a lot of stress or a lack of sleep or food are a few of them. For females, the "time of the month" can make you feel really grouchy and agitated as well. One of the symptoms of depression and some anxiety problems is feeling very jumpy and irritable too. Does any of these sound particularly like you, or do you think it may be something else?..
Most, if not all, people understand that we get agitated and irritable from time to time for some reason and wouldn't make too much out of it. If it's really worrying you, maybe you can explain to that person the reason why you got upset when you've figured it out and apologise.
It's good that you've picked up on things now, then, as you say, you can do things before you feel too much of a strain on you :)