Testing Waters
  • Scrapbook
  • Projects
    • Bamiyan Cultural Center
    • Bauhaus Museum
    • Better Hebbal
    • Bicycle Station
    • Cross Laminated Timber
    • Facade
    • Flowing Fabrication
    • Form from Images
    • Guggenheim Helsinki
    • National War Museum
    • National War Memorial
    • Indflorescence
    • Rectangular Compartments
    • Retail Space Layout
    • Noise Barrier : Swedevia Airport
    • Walden
    • Wilson Garden
  • Patterns
    • Area Graph
    • Array along Curve
    • Fibbonacci and Factorial
    • Gyroid
    • Hexagonal Pattern From Image
    • Hexagonal Grid
    • Koch Star
    • Mandelbrot Set
    • Pattern
    • Pattern
    • Pattern
    • Phyllotaxis
    • Random Strip Widths
    • Skewed Surface
    • Staggered Checkerboard
    • Triangle subdivision
    • Vector Field
    • Voronoi
    • Waves
    • Weave
  • Geometry
    • Boundary Curve
    • Bridging parallel curves
    • British Museum Great Court
    • Catenary
    • Delete Adjacent
    • Geodesic Sphere
    • Group Branching Curves
    • Group Circles
    • Group curves
    • K Mean
    • Nurbs Surface Irregular
    • Overlapping Petals
    • Pair Nearest
    • Parametric Shapes
    • Platonic Solids
    • Polyline to PolyArc
    • Roman Surface
    • Sagrada Familia Schools Roof
    • Sine Curve
    • Sine Ribbon
    • Spherical Transformations
    • Split Rectangle
    • Tangential Circle through Point
    • Travelling Salesman Problem
    • Unaligned Bounding Box
  • Lists
    • Alter by Boolean Sequence
    • Color by distance
    • Consecutive Points
    • Distancing
    • Divide Equally
    • Geometry from Image
    • Image based Point Density
    • Isovists
    • Reduce Color Palette
    • Replace Consecutive
    • Replace Multiple
    • Replace Recurring
    • Shadow Area
    • Shortest Path
    • Solar Analysis
    • Topography Analysis
  • Motion
    • Adjacency
    • Animate Sphere
    • Cellular Automation
    • Cloth
    • Hypotrochoid
    • Manakin
    • Rolling Spiral
    • Tan Curve
    • Trammel of Archemedes
    • Image to Integer
  • Articles
    • A Conceptual Approach to Integrating Computational Methods in Early Stage Design
    • Design Script's ambiguous and versatile Replication Guides <1>
    • Design Script's ambiguous and versatile Replication Guides <2>
Powered by GitBook
On this page
  1. Geometry

Tangential Circle through Point

Circle passing through a point and tangential to two curves

PreviousSplit RectangleNextTravelling Salesman Problem

Last updated 4 years ago

//Increase num for higher precision
//Will fail if too low and take too long if too high
num = 15;

//Centers of circles that are tangential and equidistant to the input Curves
pt1 = c1.PointAtParameter(0..1..#num);
pt2 = c2.PointAtParameter(0..1..#num);
pl1 = Plane.ByThreePoints(c1.CenterPoint,c1.CenterPoint.Translate(0,0,1),pt1);
vc1 = Vector.ByTwoPoints(c2.CenterPoint,pt2);
pt3 = Point.PruneDuplicates(List.Flatten(pt2.Project(pl1<1>,vc1<2>),-1),0.01);
ds1 = Math.Round(pt3<1>.DistanceTo(pt1<2>),1);
ds2 = Math.Round(pt3<1>.DistanceTo(pt2<2>),1);
pt4 = List.FilterByBoolMask(pt3,List.AllFalse((ds1==ds2)<1>))["out"];

//Centers that are equidistant to the input Curves and Point
ds3 = Math.Round(pt4<1>.DistanceTo(c1<2>),1);
ds4 = Math.Round(pt4<1>.DistanceTo(c2<2>),1);
ds5 = Math.Round(pt4<1>.DistanceTo(p1<2>),1);
pt5 = List.FilterByBoolMask(pt4,ds3==ds5 && ds4==ds5)["in"];
ds6 = pt5.DistanceTo(p1);
cr1 = Circle.ByCenterPointRadius(pt5,ds6);

//Geometry Color
[GeometryColor.ByGeometryColor(p1,Color.ByARGB(255,255,0,0)),
GeometryColor.ByGeometryColor(c1,Color.ByARGB(255,0,255,0)),
GeometryColor.ByGeometryColor(c2,Color.ByARGB(255,0,0,255)),
GeometryColor.ByGeometryColor(cr1[0],Color.ByARGB(255,255,0,255))];
//Curve 1
c1 = Arc.ByThreePoints(Point.ByCoordinates(-3,2),
Point.ByCoordinates(2,1),Point.ByCoordinates(5,3));

// Curve 2
c2 = Arc.ByThreePoints(Point.ByCoordinates(-6,2),
Point.ByCoordinates(-4,1),Point.ByCoordinates(0,3));

//Point
p1 = Point.ByCoordinates(-2,1);

//Limit length of arcs as much as possible
//Will fail if no circle passes through the point
//Multiple circles that satisfy the condition possible

3KB
tanPntArc.zip
archive