Initial dirty commit of old code into git

This commit is contained in:
Paul Schaub 2019-12-12 15:20:41 +01:00
commit 5546f26619
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
1985 changed files with 255900 additions and 0 deletions

29
Game/src/MathShit.java Normal file
View file

@ -0,0 +1,29 @@
public class MathShit
{
/**
* Calculates the x-component of a vector, rotated around 0|0 by angle
* @param angle angle to rotate, in radians
* @param x old x-component of the vector or point
* @param y old y-component of the vector or point
* @return the new x component
*/
public static float rotateX(double angle, float x, float y)
{
double beta = (2*Math.PI)-angle;
return (float) (Math.cos(beta)*x-Math.sin(beta)*y);
}
/**
* Calculates the y-component of a vector, rotated around 0|0 by angle
* @param angle angle to rotate, in radians
* @param x old x-component of the vector or point
* @param y old y-component of the vector or point
* @return the new y-component
*/
public static float rotateY(double angle, float x, float y)
{
double beta = (2*Math.PI)-angle;
return (float) (Math.sin(beta)*x+Math.cos(beta)*y);
}
}