LINECIRCLE
Where a line through two points crosses a circle.
Syntax
LINECIRCLE(A,B,centre,radius,n)
| Argument | Meaning |
|---|---|
| A, B | Two points on the line. The line goes on past them both ways. |
| centre, radius | The circle. |
| n | Which crossing: 0 for the first going from A towards B, 1 for the second. |
Result
A position.
Examples
In the example drawing:
| Expression | Gives |
|---|---|
LINECIRCLE(P0,P1,P2,500,0) |
[100,0] |
LINECIRCLE(P0,P1,P2,500,1) |
[900,0] |
LINECIRCLE(P1,P0,P2,500,0) |
[900,0] |
Notes
The Intersect and Split tools define the points where a line crosses an arc or circle this way, from the line's ends and the circle's centre and radius, so the points follow those points and don't depend on the elements themselves. Where the line just touches the circle, both crossings are the same point. It is an error if the line misses the circle, if A and B are the same point, or if the radius is negative.
See also: TRIANGULATE, RAYCROSSING, CROSSING, LERP.