Example usage for org.apache.commons.math3.geometry.euclidean.twod Vector2D NaN

List of usage examples for org.apache.commons.math3.geometry.euclidean.twod Vector2D NaN

Introduction

In this page you can find the example usage for org.apache.commons.math3.geometry.euclidean.twod Vector2D NaN.

Prototype

Vector2D NaN

To view the source code for org.apache.commons.math3.geometry.euclidean.twod Vector2D NaN.

Click Source Link

Document

A vector with all coordinates set to NaN.

Usage

From source file:org.evors.core.util.geometry.IntersectionTest.java

@Test
public void intersectCollinearDisjointLinesReturnNaN() {
    Intersection i = collinearDisjointA.getIntersection(collinearDisjointB);
    assertEquals(Vector2D.NaN, i.intersectionPoint);
}

From source file:org.evors.core.util.geometry.IntersectionTest.java

@Test
public void intersectCollinearOverlappingLinesReturnNaN() {
    Intersection i = collinearOverlappingA.getIntersection(collinearOverlappingB);
    assertEquals(Vector2D.NaN, i.intersectionPoint);
}

From source file:org.evors.core.util.geometry.IntersectionTest.java

@Test
public void intersectParallelLinesReturnNaN() {
    assertEquals(Vector2D.NaN, parallelA.getIntersection(parallelB).intersectionPoint);
}

From source file:org.evors.core.util.geometry.IntersectionTest.java

@Test
public void linesDontIntersect() {
    assertEquals(Vector2D.NaN, notIntersectingA.getIntersection(notIntersectingB).intersectionPoint);
}

From source file:org.evors.rs.ui.sandpit.SandPitCanvas.java

public SandPitCanvas() {

    camera = new SandPitCamera(Vector2D.ZERO, Vector2D.ZERO, 50);
    grid = new Grid(camera);

    MouseAdapter mouseAdapter = new MouseAdapter() {
        private Vector2D prevCoord = Vector2D.NaN;

        @Override/*from ww  w .  j  av  a  2 s  .c  o m*/
        public void mouseDragged(MouseEvent me) {
            Vector2D newCoord = getCamera().convertScreenToWorldCoords(new Vector2D(me.getX(), me.getY()));
            if (prevCoord == Vector2D.NaN) {
                prevCoord = newCoord;
            } else {
                Vector2D sub = newCoord.subtract(prevCoord);
                getCamera().move(sub);
                draw();
            }
        }

        @Override
        public void mouseReleased(MouseEvent me) {
            prevCoord = Vector2D.NaN;
        }

        @Override
        public void mouseWheelMoved(MouseWheelEvent mwe) {
            getCamera().changeScale(-0.5 * mwe.getUnitsToScroll());
            draw();
        }

    };

    addMouseListener(mouseAdapter);
    addMouseMotionListener(mouseAdapter);
    addMouseWheelListener(mouseAdapter);

}