mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 19:31:16 +01:00
21 lines
359 B
Plaintext
21 lines
359 B
Plaintext
class Ground {
|
|
float x1, y1, x2, y2;
|
|
float x, y, len, rot;
|
|
|
|
// Default constructor
|
|
Ground(){
|
|
}
|
|
|
|
// Constructor
|
|
Ground(float x1, float y1, float x2, float y2) {
|
|
this.x1 = x1;
|
|
this.y1 = y1;
|
|
this.x2 = x2;
|
|
this.y2 = y2;
|
|
x = (x1+x2)/2;
|
|
y = (y1+y2)/2;
|
|
len = dist(x1, y1, x2, y2);
|
|
rot = atan2((y2-y1), (x2-x1));
|
|
}
|
|
}
|