Ejemplo n.º 1
0
def test_circle_overlap():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    assert _circle_overlap(pt1, pt2) == 0.68503764247429266
    assert _circle_overlap(pt2, pt1) == 0.68503764247429266
Ejemplo n.º 2
0
def test_circle_overlap():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    assert _circle_overlap(pt1, pt2) == 0.68503764247429266
    assert _circle_overlap(pt2, pt1) == 0.68503764247429266
Ejemplo n.º 3
0
def test_ellipse_overlap():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    npt.assert_almost_equal(_circle_overlap(pt1, pt2),
                            _ellipse_overlap(pt1, pt2), decimal=2)
Ejemplo n.º 4
0
def test_ellipse_corr():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    npt.assert_almost_equal(_circle_overlap(pt1, pt2, return_corr=True),
                            _ellipse_overlap(pt1, pt2, return_corr=True),
                            decimal=2)
Ejemplo n.º 5
0
def test_ellipse_overlap():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    npt.assert_almost_equal(_circle_overlap(pt1, pt2),
                            _ellipse_overlap(pt1, pt2),
                            decimal=2)
Ejemplo n.º 6
0
def test_ellipse_corr():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    npt.assert_almost_equal(_circle_overlap(pt1, pt2, return_corr=True),
                            _ellipse_overlap(pt1, pt2, return_corr=True),
                            decimal=2)
Ejemplo n.º 7
0
def test_circle_corr_inside():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 10, 8, 8, 0)

    # Reduces to ratio of the radii for this case
    corr = 0.8

    npt.assert_almost_equal(_circle_overlap(pt1, pt2, return_corr=True), corr)
Ejemplo n.º 8
0
def test_circle_corr():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    Aover = 0.68503764247429266 * np.pi * 10**2
    corr = Aover / (np.pi * 10 * 10)

    npt.assert_almost_equal(_circle_overlap(pt1, pt2, return_corr=True), corr)
Ejemplo n.º 9
0
def test_circle_corr_inside():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 10, 8, 8, 0)

    # Reduces to ratio of the radii for this case
    corr = 0.8

    npt.assert_almost_equal(_circle_overlap(pt1, pt2, return_corr=True), corr)
Ejemplo n.º 10
0
def test_circle_corr():

    pt1 = (10, 10, 10, 10, 0)
    pt2 = (10, 15, 10, 10, 0)

    Aover = 0.68503764247429266 * np.pi * 10**2
    corr = Aover / (np.pi * 10 * 10)

    npt.assert_almost_equal(_circle_overlap(pt1, pt2, return_corr=True), corr)