Yesterday morning in class I said something and my teacher snapped at me out of nowhere. 

She had asked a question and I said that it was vague (because I always try to answer the questions and participate in class but it’s difficult to answer a question if I don’t know what she’s asking) and she snapped at me saying that I had been “coming for her all morning” and “muttering things under my breath” and that I’m done talking and I had no idea what she was talking about. I tried to say that it was just a vague question and I don’t know how to answer a vague question but she cut me off and said “no we’re done.” 

I tried to stop myself but I was only able to hold back a panic attack for like ten seconds. As soon as it started she told me that I should leave the classroom (and my friend asked a minute later if she could come out to check on me and she did). I ended up going to the LRC (the learning resource center) to calm down. (I had taken the SAT and ACT in there because I have extended time and frequent breaks and the person who proctored my tests said that I could come there if I was feeling overstimulated in school). 

Anyway I haven’t seen that teacher since yesterday morning when I had the panic attack and my friend told me that she’s going to talk to me next week. The only thing I can think of that could’ve set her off is that I said earlier (in a very polite way) that something she was doing may not have been the best thing (she was messing with my friend who also has anxiety about stuff that was important to her, the same friend who came out to check on me).

I don’t understand how either of these things could have caused this reaction and I’m a senior now but I’ve had a relatively good relationship with this teacher since tenth grade. 

Does anyone have any advice on how to handle the situation?

(I put this under need a hug/support because I guess needing help/advice is needing support).