mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 13:50:23 +01:00
Renamed find_circle_tangents() to circle_point_tangents()
This commit is contained in:
parent
00ee79aacf
commit
9c2cf53b2d
@ -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))
|
||||
|
@ -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() {
|
||||
|
@ -8,7 +8,7 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,321];
|
||||
BOSL_VERSION = [2,0,322];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
Loading…
x
Reference in New Issue
Block a user