After listening to a few concepts that I didn't hear wrong in class, I felt bored, and I was scolded for writing other homework. Actually, I don't think there is anything wrong with your homework, because that's what I did in high school. I am good at math, so I can squeeze in some time to do something else. Fortunately, I met a more enlightened teacher. For your flying teacher, I suggest that you can put forward the concept of what teaching materials he wants to talk about, or ask him to take notes in advance and memorize these things, so that he can't catch your excuses.
Last two points. In terms of misunderstanding, if you feel misunderstood, don't be afraid of confrontation. If you have anything, speak up. In fact, the teacher scolds the students because he has the right to suppress others, and will call the parents to say you under the banner of disrespecting the teacher. So you can confront each other, but you can't scold each other, and you can't let them hold on to you. You can find fault with him in other ways.
Do things. When you are very talented in a certain field and can achieve good results without too much effort, the challenge of this matter lies in whether you can be patient and make the details perfect. In the matter of mathematics, you have stumbled over several conceptual problems that you have despised several times. Instead of always finding fault with you, it is better to say that you will meet the requirements and picky of your superiors everywhere in the future. So if you can be patient and do it perfectly this time, you will have the mentality and action to treat all similar events. Improving yourself at this point is your greatest gain in this "math teacher incident".
Supplement: Learning life is not necessarily the whole of your life. If you encounter some setbacks with your teacher, you can put your energy and enthusiasm on what you like (beneficial to yourself) and let yourself look down on your troubles. This is why I suggest that you can study junior high school mathematics and senior high school mathematics. Of course, you can choose other good things. I usually play Rubik's Cube, do some prisoner fitness, sing loudly at home, and play the violin before.