Ball-Simulator
README.md
Ball-Simulator
The Reflection algorithm on the example of Balls.
- Coordinate system: Axis OX directed from left to right, axis OY directed from buttom to top. Y ^ . . . . .-------------->X
- The Ball has start coordinate of centre (x,y), start direction angle in degrees (f), X-axis radius (R1), Y-axis radius (R2) and speed in pi/10ms(speed).
- Speed splits into speed along the X-axis (newX) and along Y-axis (newY). So newX^2 + newY^2 = speed^2
- Surface angle counts down counterclockwise
/-f--- -- a
---/---- f - is possitive -------- a - is negative - The Reflection algorithm is in ballWindow.py (changeDirection(a,ball)), where a -angle of reflection and ball - reflecting ball. Algorithm based on projection on sufface of reflection, changing of vertical speed and return back to main X-Y basis.
Описание
Algorithm of reflection from surface with any degrees
Языки
Python
- CSS
- Batchfile