// Path: src/main/java/com/github/davidmoten/rtree/geometry/Geometries.java
// public static Point point(double x, double y) {
//     return PointDouble.create(x, y);
// }


import static com.github.davidmoten.rtree.geometry.Geometries.point;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.awt.geom.Line2D;
import org.junit.Test;
    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsWestEdge() {
        Line a = Geometries.line(3, 1, 3, 10);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsNorthEdge() {
        Line a = Geometries.line(2, 7, 10, 7);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsSouthEdge() {
        Line a = Geometries.line(2, 3, 10, 3);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsEastEdge() {
        Line a = Geometries.line(7, 1, 7, 10);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDoesNotIntersectsPoint() {
// Path: src/main/java/com/github/davidmoten/rtree/geometry/Geometries.java
// public static Point point(double x, double y) {
//     return PointDouble.create(x, y);
// }


// Path: src/test/java/com/github/davidmoten/rtree/geometry/LineTest.java
import static com.github.davidmoten.rtree.geometry.Geometries.point;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.awt.geom.Line2D;
import org.junit.Test;

    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsWestEdge() {
        Line a = Geometries.line(3, 1, 3, 10);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsNorthEdge() {
        Line a = Geometries.line(2, 7, 10, 7);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsSouthEdge() {
        Line a = Geometries.line(2, 3, 10, 3);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDistanceToRectangleIsZeroWhenContainsEastEdge() {
        Line a = Geometries.line(7, 1, 7, 10);
        Rectangle r = Geometries.rectangle(3, 3, 7, 7);
        assertEquals(0, a.distance(r), PRECISION);
    }

    @Test
    public void testLineDoesNotIntersectsPoint() {
        assertFalse(Geometries.line(1.5, 1.5, 2.6, 2.5).intersects(point(2, 2)));