diff --git a/geometry.scad b/geometry.scad index fb96fb1..87c3865 100644 --- a/geometry.scad +++ b/geometry.scad @@ -1070,9 +1070,9 @@ function find_circle_3points(pt1, pt2, pt3) = -// Function: find_circle_tangents() +// Function: circle_point_tangents() // Usage: -// tangents = find_circle_tangents(r|d, cp, pt); +// tangents = circle_point_tangents(r|d, cp, pt); // Description: // Given a circle and a point outside that circle, finds the tangent point(s) on the circle for a // line passing through the point. Returns list of zero or more sublists of [ANG, TANGPT] @@ -1083,12 +1083,12 @@ function find_circle_3points(pt1, pt2, pt3) = // pt = The coordinates of the external point. // Example(2D): // cp = [-10,-10]; r = 30; pt = [30,10]; -// tanpts = subindex(find_circle_tangents(r=r, cp=cp, pt=pt),1); +// tanpts = subindex(circle_point_tangents(r=r, cp=cp, pt=pt),1); // color("yellow") translate(cp) circle(r=r); // color("cyan") for(tp=tanpts) {stroke([tp,pt]); stroke([tp,cp]);} // color("red") move_copies(tanpts) circle(d=3,$fn=12); // color("blue") move_copies([cp,pt]) circle(d=3,$fn=12); -function find_circle_tangents(r, d, cp, pt) = +function circle_point_tangents(r, d, cp, pt) = assert(is_num(r) || is_num(d)) assert(is_vector(cp)) assert(is_vector(pt)) diff --git a/tests/test_geometry.scad b/tests/test_geometry.scad index 47f28f3..ce69361 100644 --- a/tests/test_geometry.scad +++ b/tests/test_geometry.scad @@ -294,8 +294,8 @@ module test_find_circle_3points() { test_find_circle_3points(); -module test_find_circle_tangents() { - tangs = find_circle_tangents(r=50,cp=[0,0],pt=[50*sqrt(2),0]); +module test_circle_point_tangents() { + tangs = circle_point_tangents(r=50,cp=[0,0],pt=[50*sqrt(2),0]); assert(approx(subindex(tangs,0), [45,-45])); expected = [for (ang=subindex(tangs,0)) polar_to_xy(50,ang)]; got = subindex(tangs,1); @@ -304,7 +304,7 @@ module test_find_circle_tangents() { assert(approx(flatten(got), flatten(expected))); } } -test_find_circle_tangents(); +test_circle_point_tangents(); module test_tri_calc() { diff --git a/version.scad b/version.scad index 86be24b..bdfa4b3 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,321]; +BOSL_VERSION = [2,0,322]; // Section: BOSL Library Version Functions