[SOLVED] Calculate the degrees?


  • *
  • Posts: 84
Good morning to all,

I need a food for thought, please

I'm currently testing an accelerometer game.
I want the "ball" to hit an object and be pushed back in the opposite direction.
At the moment of the collision, I only have the data x-speed and y-speed of the ball available.

Is it possible to calculate the number of degrees from the two variables and to convert them in the opposite direction?

I hope I have not expressed myself too stupidly now.
I have inserted a small picture.


« Last Edit: June 07, 2020, 04:53:19 am by TF101 »


  • *
  • Posts: 2720
You can use the wonderful, excellent, magnificent and impressive EasyMath extension:

I use it a lot.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.


  • *
  • Posts: 84
Many thanks for your response.
I looked at the wonderful, excellent, magnificent and impressive extension.
I think that will solve my problem. The ball bounces violently but not quite as i want it to.
But I'm sure that I can do it with some work.

Kind regards,