// Path: src/gwt/java/pythagoras/util/Platform.java
// public class Platform
// {
//     /**
//      * Returns a hash code for the supplied float value.
//      */
//     public static int hashCode (float f1) {
//         return (int)f1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Returns a hash code for the supplied double value.
//      */
//     public static int hashCode (double d1) {
//         return (int)d1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Clones the supplied array of bytes.
//      */
//     public static native byte[] clone (byte[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of ints.
//      */
//     public static native int[] clone (int[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of floats.
//      */
//     public static native float[] clone (float[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of doubles.
//      */
//     public static native double[] clone (double[] values) /*-{
//         return values.slice(0);
//     }-*/;
// }


import pythagoras.util.Platform;
    public Point rotate (double angle) {
        return rotate(angle, new Point());
    }

    @Override // from IPoint
    public Point rotate (double angle, Point result) {
        double x = x(), y = y();
        double sina = Math.sin(angle), cosa = Math.cos(angle);
        return result.set(x*cosa - y*sina, x*sina + y*cosa);
    }

    @Override // from IPoint
    public Point clone () {
        return new Point(this);
    }

    @Override
    public boolean equals (Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof AbstractPoint) {
            AbstractPoint p = (AbstractPoint)obj;
            return x() == p.x() && y() == p.y();
        }
        return false;
    }

    @Override
    public int hashCode () {
// Path: src/gwt/java/pythagoras/util/Platform.java
// public class Platform
// {
//     /**
//      * Returns a hash code for the supplied float value.
//      */
//     public static int hashCode (float f1) {
//         return (int)f1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Returns a hash code for the supplied double value.
//      */
//     public static int hashCode (double d1) {
//         return (int)d1; // alas nothing better can be done in JavaScript
//     }
// 
//     /**
//      * Clones the supplied array of bytes.
//      */
//     public static native byte[] clone (byte[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of ints.
//      */
//     public static native int[] clone (int[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of floats.
//      */
//     public static native float[] clone (float[] values) /*-{
//         return values.slice(0);
//     }-*/;
// 
//     /**
//      * Clones the supplied array of doubles.
//      */
//     public static native double[] clone (double[] values) /*-{
//         return values.slice(0);
//     }-*/;
// }


// Path: src/main/java/pythagoras/d/AbstractPoint.java
import pythagoras.util.Platform;

    public Point rotate (double angle) {
        return rotate(angle, new Point());
    }

    @Override // from IPoint
    public Point rotate (double angle, Point result) {
        double x = x(), y = y();
        double sina = Math.sin(angle), cosa = Math.cos(angle);
        return result.set(x*cosa - y*sina, x*sina + y*cosa);
    }

    @Override // from IPoint
    public Point clone () {
        return new Point(this);
    }

    @Override
    public boolean equals (Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof AbstractPoint) {
            AbstractPoint p = (AbstractPoint)obj;
            return x() == p.x() && y() == p.y();
        }
        return false;
    }

    @Override
    public int hashCode () {
        return Platform.hashCode(x()) ^ Platform.hashCode(y());