All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.harium.etyl.commons.event.GestureEvent Maven / Gradle / Ivy

There is a newer version: 1.4.2
Show newest version
package com.harium.etyl.commons.event;


public class GestureEvent {
    int pointer;
    int x;
    int y;

    public GestureEvent() {
        this(0, 0, 0);
    }

    public GestureEvent(int pointer, int x, int y) {
        this.pointer = pointer;
        this.x = x;
        this.y = y;
    }

    public double distance(int bx, int by) {
        float dx = bx - x;
        float dy = by - y;
        return Math.sqrt((dx * dx) + (dy * dy));
    }

    public double distance(GestureEvent b) {
        return distance(b.x, b.y);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy