/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dataBase.search.distance;

import dataBase.subPicture.Pixel;

/**
 *
 * @author Niklas
 */
public class Distance_L2 extends AbstractDistance {

	@Override
	public float getDistance(Pixel p1, Pixel p2) {
		float dist = 0;
		dist += Math.abs((p1.r-p2.r) * (p2.r-p1.r));
		dist += Math.abs((p1.g-p2.g) * (p2.g-p1.g));
		dist += Math.abs((p1.b-p2.b) * (p2.b-p1.b));
		
		return  dist;
	}

}
