added position + ball

This commit is contained in:
GordonDaFreeman 2017-09-19 18:25:29 +02:00
parent 0c5e46fbf2
commit 57938354ef
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,20 @@
package fußballmanager;
public class Flugbahn {
//Steigung m
//Y-Achsen abschnitt b
//Definitionsbereich x1 und x2 + y1 und y2
double m,b;
//double x1,x2,y1,y2;
public Flugbahn(Position p1,Position p2) {
m = (p1.y-p2.y)/(p1.x-p2.x);
b = p1.y+m*p1.x;
}
//Moritz mach das mal :D
public double getDistancToPosition(Position p){
return 0;
}
}

View File

@ -0,0 +1,19 @@
package fußballmanager;
public class Position {
double x,y;
public Position(double x,double y){
this.x = x;
this.y = y;
}
//Berechnung der Distanz zwischen zwei Punkten/Positionen mittels Satz des Pytagoras
public double getDistance(Position p){
double a,b;
a = Math.abs(x-p.x);
b = Math.abs(y-p.y);
return Math.sqrt(a*a+b*b);
}
}

View File

@ -0,0 +1,7 @@
package fußballmanager.personen;
import fußballmanager.Position;
public class Ball{
Position p;
}

View File

@ -1,11 +1,13 @@
package fußballmanager.personen;
import fußballmanager.Position;
import fußballmanager.Team;
public abstract class Person {
int alter;
Team team;
String name,vorname;
Position p;
public void setTeam(Team team){
this.team = team;