今天好像很闲阿。作题拉:
circle:
A(x1,y1)
B(x2,y2)
C(x3,y3 )
first get the vertical equal-split line of line AB:
ponit1 D( (x1+x2)/2, (y1+y2)/2 )
point2 E( (x1+x2)/2 - (y2 - (y1+y2)/2), (y1+y2)/2 - ( x2-(x1+x2)/2) )
same way, get the vertical equal-split line of line BC:
F
G
Now we need to find the join point of Line DE and Line FG.
general argrithum for join point of two lines:
D(xd,yd) E(xe,ye) ( xe> xd)
F(xf,yf) G(xg,yg) ( xg>xf )
Jion point J: ( xj,yj) should be
(xj-xd)/(xe-xd) = ( yj-yd)/(ye-yd)
(xj-xf)/(xg-xf) = ( yj-yf)/(yg-yf)
Then we can get xj and yj.
This join point is the center of this circle.
Then we can get the R of this circle.
For the other line O(xo,yo)P(xp,yp), need to create a vertical line with OP, and go through J, then caculate the join point Q, and find the length of JQ
caculate the length of JQ, if it's less than R, they are joined.
circle:
A(x1,y1)
B(x2,y2)
C(x3,y3 )
first get the vertical equal-split line of line AB:
ponit1 D( (x1+x2)/2, (y1+y2)/2 )
point2 E( (x1+x2)/2 - (y2 - (y1+y2)/2), (y1+y2)/2 - ( x2-(x1+x2)/2) )
same way, get the vertical equal-split line of line BC:
F
G
Now we need to find the join point of Line DE and Line FG.
general argrithum for join point of two lines:
D(xd,yd) E(xe,ye) ( xe> xd)
F(xf,yf) G(xg,yg) ( xg>xf )
Jion point J: ( xj,yj) should be
(xj-xd)/(xe-xd) = ( yj-yd)/(ye-yd)
(xj-xf)/(xg-xf) = ( yj-yf)/(yg-yf)
Then we can get xj and yj.
This join point is the center of this circle.
Then we can get the R of this circle.
For the other line O(xo,yo)P(xp,yp), need to create a vertical line with OP, and go through J, then caculate the join point Q, and find the length of JQ
caculate the length of JQ, if it's less than R, they are joined.