/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pnandmd.Contacts;

/**
 *Klasa dokonujaca konwersji wspolrzednych na numer klatki.
 * Gestosc to parametr konstruktora.
 * @author Ania
 */
public class Konwerter {
    
    private double n;
    
    public Konwerter(float mm){
        n = mm;
    }
    
    public int konwertuj(double a){
        int w;
        w = (int)(a / n);
        if(w == 0){
            w = (int) (1 * Math.signum(a));
        }
        else if(w > 0){
            w++;
        }
        else if(w < 0){
            w--;
        }
        return w;
    }
    
}

