forked from srinathr91/TestJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBall.java
More file actions
36 lines (33 loc) · 699 Bytes
/
Ball.java
File metadata and controls
36 lines (33 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* Ball class
*/
public class Ball{
//initial coordinates
public float x,y;
//coordinates at time t
public float xt,yt;
//initial velocity
public float ux,uy;
//final velocity
public float vx,vy;
//speed of ball
public double modV;
public double getModV() {
return modV;
}
public void setModV() {
//this.vx=vx;
//this.vy=vy;
double temp=(vx*vx)+(vy*vy);
modV=Math.sqrt(temp);
}
//collusion detection
public int coll_flag;
public boolean coll_dect;
//internal parameters
double S1x,S2x,S1y,S2y;
double pt1y,pt1x;
double npx, npy, vix, viy, vfx, vfy;
double dotProd;
public int collided_flag;
}