Esempio 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
Esempio 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
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)