package models.distances;
import views.Astre;
import views.Star;
/**
* Distance based on the magnitude of a Star
* ! Can only be used for stars
* @author clement
*
*/
public class MagnitudeDistance extends Distance {
private static String name = "Magnitude";
private static String description = "Distance basée sur l'écart des magnitudes";
private static final int dimension = 1;
/**
*
* @param a
* @param b
* @return
*/
@Override
public double get(Astre a, Astre b) {
Star s1 = (Star) a;
Star s2 = (Star) b;
return Math.abs(s1.getMagnitude() - s2.getMagnitude());
}
@Override
public String getName() {
return name;
}
@Override
public String getDescription() {
return description;
}
@Override
public int getDimension(){
return dimension;
}
}