Debian Codegraph @

texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-lua-intersections.tex

raw
1 % tkz-tools-lua-intersections.tex
2 % Copyright 2011-2026 Alain Matthes
3 % SPDX-License-Identifier: LPPL-1.3c
4 % Maintainer: Alain Matthes
5
6 \typeout{2026/01/25 5.13c tkz-tools-lua-intersections.tex}
7 \makeatletter
8 %<--------------------------------------------------------------------------–>
9 % intersection de deux lignes
10 %<--------------------------------------------------------------------------–>
11 \def\tkzInterLL(#1,#2)(#3,#4){% méthode avec xfp
12 \tkz@InterLL(#1,#2)(#3,#4){tkzPointResult}
13 }
14
15 \def\tkz@InterLL(#1,#2)(#3,#4)#5{%
16 \pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}}%
17 \pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}}%
18 \tkz@ax\pgf@x%
19 \tkz@ay\pgf@y%
20 \pgfextractx{\pgf@x}{\pgfpointanchor{#2}{center}}%
21 \pgfextracty{\pgf@y}{\pgfpointanchor{#2}{center}}
22 \tkz@bx\pgf@x%
23 \tkz@by\pgf@y%
24 \pgfextractx{\pgf@x}{\pgfpointanchor{#3}{center}}%
25 \pgfextracty{\pgf@y}{\pgfpointanchor{#3}{center}}%
26 \tkz@cx\pgf@x%
27 \tkz@cy\pgf@y%
28 \pgfextractx{\pgf@x}{\pgfpointanchor{#4}{center}}%
29 \pgfextracty{\pgf@y}{\pgfpointanchor{#4}{center}}%
30 \tkz@dx\pgf@x%
31 \tkz@dy\pgf@y%
32 \edef\tkzax{\strip@pt\tkz@ax}%
33 \edef\tkzay{\strip@pt\tkz@ay}%
34 \edef\tkzbx{\strip@pt\tkz@bx}%
35 \edef\tkzby{\strip@pt\tkz@by}%
36 \edef\tkzcx{\strip@pt\tkz@cx}%
37 \edef\tkzcy{\strip@pt\tkz@cy}%
38 \edef\tkzdx{\strip@pt\tkz@dx}%
39 \edef\tkzdy{\strip@pt\tkz@dy}%
40 \edef\tkz@deltax{\tkz@Dec{(\tkzax-(\tkzbx))/(28.45274)}}
41 \edef\tkz@deltaxx{\tkz@Dec{(\tkzcx-(\tkzdx))/(28.45274)}}
42 \edef\tkz@deltay{\tkz@Dec{(\tkzay-(\tkzby))/(28.45274)}}
43 \edef\tkz@deltayy{\tkz@Dec{(\tkzcy-(\tkzdy))/(28.45274)}}
44 \edef\tkz@deltaxy{\tkz@Dec{((\tkzax*\tkzby)-(\tkzay*\tkzbx))/(809.55841)}}
45 \edef\tkz@deltaxxyy{\tkz@Dec{((\tkzcx*\tkzdy)-(\tkzcy*\tkzdx))/(809.55841)}}
46 \edef\tkz@div{\tkz@Dec{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}}
47 \edef\tkz@numx{\tkz@Dec{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}}
48 \edef\tkz@numy{\tkz@Dec{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}}
49 \edef\tkz@xs{\tkz@Dec{\tkz@numx/\tkz@div}}
50 \edef\tkz@ys{\tkz@Dec{\tkz@numy/\tkz@div}}
51 \edef\tkz@xs{\tkz@Round{\tkz@xs}{5}}
52 \edef\tkz@ys{\tkz@Round{\tkz@ys}{5}}
53 \path[coordinate](\tkz@xs,\tkz@ys) coordinate (#5);
54 }
55
56
57 % méthode with coordinates
58 \def\tkzInterLLxy(#1,#2,#3,#4)(#5,#6,#7,#8){%
59 %\path (intersection of #1--#2 and #3--#4) coordinate(#5);%
60 \tkz@ax#1%
61 \tkz@ay#2%
62 \tkz@bx#3%
63 \tkz@by#4%
64 \tkz@cx#5%
65 \tkz@cy#6%
66 \tkz@dx#7%
67 \tkz@dy#8%
68 \edef\tkzax{\strip@pt\tkz@ax}%
69 \edef\tkzay{\strip@pt\tkz@ay}%
70 \edef\tkzbx{\strip@pt\tkz@bx}%
71 \edef\tkzby{\strip@pt\tkz@by}%
72 \edef\tkzcx{\strip@pt\tkz@cx}%
73 \edef\tkzcy{\strip@pt\tkz@cy}%
74 \edef\tkzdx{\strip@pt\tkz@dx}%
75 \edef\tkzdy{\strip@pt\tkz@dy}%
76 \edef\tkz@deltax{\tkz@Dec{(\tkzax-(\tkzbx))/(28.45274)}}
77 \edef\tkz@deltaxx{\tkz@Dec{(\tkzcx-(\tkzdx))/(28.45274)}}
78 \edef\tkz@deltay{\tkz@Dec{(\tkzay-(\tkzby))/(28.45274)}}
79 \edef\tkz@deltayy{\tkz@Dec{(\tkzcy-(\tkzdy))/(28.45274)}}
80 \edef\tkz@deltaxy{\tkz@Dec{((\tkzax*\tkzby)-(\tkzay*\tkzbx))/(809.55841)}}
81 \edef\tkz@deltaxxyy{\tkz@Dec{((\tkzcx*\tkzdy)-(\tkzcy*\tkzdx))/(809.55841)}}
82 \edef\tkz@div{\tkz@Dec{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}}
83 \edef\tkz@numx{\tkz@Dec{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}}
84 \edef\tkz@numy{\tkz@Dec{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}}
85 \edef\tkz@xs{\tkz@Dec{\tkz@numx/\tkz@div}}
86 \edef\tkz@ys{\tkz@Dec{\tkz@numy/\tkz@div}}
87 \edef\tkz@xs{\tkz@Round{\tkz@xs}{5}}
88 \edef\tkz@ys{\tkz@Round{\tkz@ys}{5}}
89 \path[coordinate](\tkz@xs,\tkz@ys) coordinate (tkzPointResult);
90 }
91
92 %<--------------------------------------------------------------------------–>
93 % intersection de Ligne Cercle rayon connu
94 %<--------------------------------------------------------------------------–>
95 % /*
96 % Calculate the intersection of a ray and a sphere
97 % The line segment is defined from p1 to p2
98 % The sphere is of radius r and centered at sc
99 % There are potentially two points of intersection given by
100 % p = p1 + mu1 (p2 - p1)
101 % p = p1 + mu2 (p2 - p1)
102 % Return FALSE if the ray doesn't intersect the sphere.
103 % */
104 % int RaySphere(XYZ p1,XYZ p2,XYZ sc,double r,double *mu1,double *mu2)
105 % {
106 % double a,b,c;
107 % double bb4ac;
108 % XYZ dp;
109 %
110 % dp.x = p2.x - p1.x;
111 % dp.y = p2.y - p1.y;
112 % dp.z = p2.z - p1.z;
113 % a = dp.x * dp.x + dp.y * dp.y + dp.z * dp.z;
114 % b = 2 * (dp.x * (p1.x - sc.x) + dp.y * (p1.y - sc.y) + dp.z * (p1.z - sc.z));
115 % c = sc.x * sc.x + sc.y * sc.y + sc.z * sc.z;
116 % c += p1.x * p1.x + p1.y * p1.y + p1.z * p1.z;
117 % c -= 2 * (sc.x * p1.x + sc.y * p1.y + sc.z * p1.z);
118 % c -= r * r;
119 % bb4ac = b * b - 4 * a * c;
120 % if (ABS(a) < EPS || bb4ac < 0) {
121 % *mu1 = 0;
122 % *mu2 = 0;
123 % return(FALSE);
124 % }
125 %
126 % *mu1 = (-b + sqrt(bb4ac)) / (2 * a);
127 % *mu2 = (-b - sqrt(bb4ac)) / (2 * a);
128 %
129 % return(TRUE);
130 % }
131 %<---------- test ------------------------------------------------------–>
132 \def\tkzTestInterLC(#1,#2)(#3,#4){%
133 \begingroup
134 \tkz@Projection(#1,#2)(#3){tkz@pth}% distance centre à la ligne
135 \tkz@@CalcLength(#3,tkz@pth){tkz@mathLen}%
136 \tkz@@CalcLength(#3,#4){tkzLengthResult}%calcul du rayon
137 \ifdim\tkz@mathLen pt>\tkzLengthResult pt\relax%
138 \global\tkzFlagLCfalse
139 \else
140 \global\tkzFlagLCtrue
141 \fi
142 \endgroup
143 }
144 %<--------------------------------------------------------------------------–>
145 \def\tkz@numlc{0}
146 \pgfkeys{/linecircle/.cd,
147 node/.code = \def\tkz@numlc{0},
148 R/.code = \def\tkz@numlc{1},
149 with nodes/.code = \def\tkz@numlc{2},
150 common/.store in = \tkz@common,
151 common = {},
152 near/.is if = tkz@near,
153 near/.default = true,
154 near = false,
155 next to/.store in = \tkz@nextto,
156 next to/.initial = {},
157 next/.default = {},
158 next to = {},
159 next to/.value required,
160 node
161 }
162 %<--------------------------------------------------------------------------–>
163 \def\tkzInterLC{\pgfutil@ifnextchar[{\tkz@InterLC}{\tkz@InterLC[]}}
164 \def\tkz@InterLC[#1](#2,#3)(#4,#5){%
165 \begingroup
166 \pgfqkeys{/linecircle}{#1}
167 \pgfinterruptboundingbox
168 \ifcase\tkz@numlc%
169 % first case 0
170 \tkz@@CalcLength(#4,#5){tkzLengthResult}
171 \tkzInterLCR(#2,#3)(#4,\tkzLengthResult pt){tkzFirstPointResult}%
172 {tkzSecondPointResult}
173 \or% 1
174 \tkzInterLCR(#2,#3)(#4,#5 cm){tkzFirstPointResult}
175 {tkzSecondPointResult}%
176 \or% 2
177 \tkzInterLCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}%
178 {tkzSecondPointResult}%
179 \fi
180 \iftkz@near
181 \tkz@@CalcLength(#2,tkzFirstPointResult){tkzLengthFirst}
182 \tkz@@CalcLength(#2,tkzSecondPointResult){tkzLengthSecond}
183 \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax%
184 \else
185 \pgfnodealias{tkzPointTmp}{tkzSecondPointResult}
186 \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult}
187 \pgfnodealias{tkzFirstPointResult}{tkzPointTmp}
188 \fi
189 \else
190 \ifx\tkz@common\tkzutil@empty
191 \ifx\tkz@nextto\tkzutil@empty
192 \tkzFindAngle(tkzSecondPointResult,tkzFirstPointResult,#4)
193 \tkzGetAngle{tkz@an}
194 \ifdim\tkz@an pt<180 pt\relax%
195 \else
196 \pgfnodealias{tkzPointTmp}{tkzSecondPointResult}
197 \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult}
198 \pgfnodealias{tkzFirstPointResult}{tkzPointTmp}
199 \fi
200 \else
201 \tkz@@CalcLength(\tkz@nextto,tkzFirstPointResult){tkzLengthFirst}
202 \tkz@@CalcLength(\tkz@nextto,tkzSecondPointResult){tkzLengthSecond}
203 \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax%
204 \else
205 \pgfnodealias{tkzPointTmp}{tkzSecondPointResult}
206 \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult}
207 \pgfnodealias{tkzFirstPointResult}{tkzPointTmp}
208 \fi
209 \fi
210 \else
211 \tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen}
212 \ifdim\tkz@mathLen pt<1pt\relax%
213 \else
214 \pgfnodealias{tkzPointTmp}{tkzSecondPointResult}
215 \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult}
216 \pgfnodealias{tkzFirstPointResult}{tkzPointTmp}
217 \fi
218 \fi
219 \fi%near
220 \endpgfinterruptboundingbox
221 \endgroup
222 }
223 %<--------------------------------------------------------------------------–>
224 %<--------------------------------------------------------------------------–>
225 \def\tkzInterLCR(#1,#2)(#3,#4)#5#6{%
226 \begingroup
227 \tkz@radi=#4%
228 \tkz@@extractxy{#3}
229 \tkz@bx =\pgf@x\relax%
230 \tkz@by =\pgf@y\relax%
231 \tkz@Projection(#1,#2)(#3){tkz@pth}
232 \tkz@@CalcLength(#3,tkz@pth){tkz@mathLen}
233 \ifdim\tkz@mathLen pt<0.05pt\relax%
234 \pgfpointdiff{\pgfpointanchor{#1}{center}}%
235 {\pgfpointanchor{#2}{center}}%
236 \tkz@ax=\pgf@x%
237 \tkz@ay=\pgf@y%
238 \pgfpointborderellipse{\pgfpoint{\tkz@ax}{\tkz@ay}}%
239 {\pgfpoint{\tkz@radi}{\tkz@radi}}
240 \tkz@ax=\pgf@x\relax%
241 \tkz@ay=\pgf@y\relax%
242 \advance\tkz@bx by\tkz@ax\relax%
243 \advance\tkz@by by\tkz@ay\relax%
244 \pgfcoordinate{#6}{\pgfqpoint{\tkz@bx}{\tkz@by}}
245 \tkzCSym(#3)(#6){#5}
246 \else
247 \edef\pgfmathresult{\fpeval{\tkz@mathLen/\tkz@radi}}
248 % \edef\tkz@angle{\fpeval{acosd(\pgfmathresult)}}
249 \pgfmathacos@{\pgfmathresult}%
250 \let\tkz@angle\pgfmathresult%
251 \pgfpointdiff{\pgfpointanchor{#3}{center}}%
252 {\pgfpointanchor{tkz@pth}{center}}%
253 \tkz@ax=\pgf@x%
254 \tkz@ay=\pgf@y%
255 \pgfpointborderellipse{\pgfpoint{\tkz@ax}{\tkz@ay}}%
256 {\pgfpoint{\tkz@radi}{\tkz@radi}}
257 \tkz@ax =\pgf@x\relax%
258 \tkz@ay =\pgf@y\relax%
259 \advance\tkz@bx by\tkz@ax\relax%
260 \advance\tkz@by by\tkz@ay\relax%
261 \tkz@@extractxy{#3}
262 \tkz@ax =\pgf@x\relax%
263 \tkz@ay =\pgf@y\relax%
264 \tkz@@extractxy{tkz@pth}
265 \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}%
266 {\pgfpoint{\tkz@ax}{\tkz@ay}}%
267 {\tkz@angle}
268 \pgfcoordinate{#5}{\pgfqpoint{\pgf@x}{\pgf@y}}
269 \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}%
270 {\pgfpoint{\tkz@ax}{\tkz@ay}}%
271 {-\tkz@angle}
272 \pgfcoordinate{#6}{\pgfqpoint{\pgf@x}{\pgf@y}}
273
274 \fi
275 \endgroup
276 }
277 %<--------------------------------------------------------------------------–>
278 % intersection de Ligne Cercle
279 % #4 center #5 point sur le cercle
280 %<--------------------------------------------------------------------------–>
281 % \def\tkzInterLC(#1,#2)(#3,#4)#5#6{%
282 % \begingroup
283 % \tkz@@CalcLength(#3,#4){tkz@rad}
284 % \tkzInterLCR(#1,#2)(#3,\tkz@rad pt){#5}{#6}
285 % \endgroup
286 % }
287 %<--------------------------------------------------------------------------–>
288 % intersection de Ligne Cercle rayon inconnu
289 %<--------------------------------------------------------------------------–>
290 \def\tkzInterLCWithNodes(#1,#2)(#3,#4,#5)#6#7{%
291 \begingroup
292 \tkz@@CalcLength(#4,#5){tkz@radius}
293 \tkzInterLCR(#1,#2)(#3,\tkz@radius pt){#6}{#7}
294 \endgroup
295 }
296 %<--------------------------------------------------------------------------–>
297 % Intersection of 2 circles
298 %<--------------------------------------------------------------------------–>
299 %<--------------------------------------------------------------------------–>
300 % méthode
301 % /* circle_circle_intersection() *
302 % * Determine the points where 2 circles in a common plane intersect.
303 % *
304 % * int circle_circle_intersection(
305 % * // center and radius of 1st circle
306 % * double x0, double y0, double r0,
307 % * // center and radius of 2nd circle
308 % * double x1, double y1, double r1,
309 % * // 1st intersection point
310 % * // 2nd intersection point
311 % *
312 % * This is a public domain work. 3/26/2005 Tim Voght
313 % *
314 % int circle_circle_intersection(double x0, double y0, double r0,
315 % double x1, double y1, double r1,
316 % double *xi, double *yi,
317 % double *xi_prime, double *yi_prime)
318 % {
319 % double a, dx, dy, d, h, rx, ry;
320 % double x2, y2;
321 %
322 % /* dx and dy are the vertical and horizontal distances between
323 % * the circle centers.
324 % */
325 % dx = x1 - x0;
326 % dy = y1 - y0;
327 %
328 % /* Determine the straight-line distance between the centers. */
329 % //d = sqrt((dy*dy) + (dx*dx));
330 % d = hypot(dx,dy); // Suggested by Keith Briggs
331 %
332 % /* Check for solvability. */
333 % if (d > (r0 + r1))
334 % {
335 % /* no solution. circles do not intersect. */
336 % return 0;
337 % }
338 % if (d < fabs(r0 - r1))
339 % {
340 % /* no solution. one circle is contained in the other */
341 % return 0;
342 % }
343 %
344 % /* 'point 2' is the point where the line through the circle
345 % * intersection points crosses the line between the circle
346 % * centers.
347 % */
348 %
349 % /* Determine the distance from point 0 to point 2. */
350 % a = ((r0*r0) - (r1*r1) + (d*d)) / (2.0 * d) ;
351 %
352 % /* Determine the coordinates of point 2. */
353 % x2 = x0 + (dx * a/d);
354 % y2 = y0 + (dy * a/d);
355 %
356 % /* Determine the distance from point 2 to either of the
357 % * intersection points.
358 % */
359 % h = sqrt((r0*r0) - (a*a));
360 %
361 % /* Now determine the offsets of the intersection points from
362 % * point 2.
363 % */
364 % rx = -dy * (h/d);
365 % ry = dx * (h/d);
366 %
367 % /* Determine the absolute intersection points. */
368 % *xi = x2 + rx;
369 % *xi_prime = x2 - rx;
370 % *yi = y2 + ry;
371 % *yi_prime = y2 - ry;
372 %
373 % return 1;
374 % }
375 %<--------------------------------------------------------------------------–>
376 % Intersection de deux cercles
377 %<--------------------------------------------------------------------------–>
378 %<---------- test ------------------------------------------------------–>
379 % test avec des nodes R-r <= d <= R+r
380 \def\tkzTestInterCC(#1,#2)(#3,#4){%
381 \begingroup
382 \tkz@@CalcLength(#1,#3){tkz@mathLen}% distance entre les centres
383 \tkz@@CalcLength(#2,#1){tkz@rA}%calcul du rayon
384 \tkz@@CalcLength(#4,#3){tkz@rB}%calcul du rayon
385 % test if d <= rA + rB ?
386 \edef\tkz@rS{\fpeval{\tkz@rA+\tkz@rB}}
387 \ifdim\tkz@mathLen pt > \tkz@rS pt\relax%
388 \global\tkzFlagCCfalse
389 \else
390 % now test if d>= rA - rB or rB-rA
391 \ifdim \tkz@rA pt > \tkz@rB pt\relax%
392 \edef\tkz@rD{\fpeval{\tkz@rA-\tkz@rB}}
393 \else
394 \edef\tkz@rD{\fpeval{\tkz@rB-\tkz@rA}}
395 \fi
396 \ifdim \tkz@rD pt > \tkz@mathLen pt\relax%
397 \global\tkzFlagCCfalse
398 \else
399 \global\tkzFlagCCtrue
400 \fi
401 \fi
402 \endgroup
403 }
404
405 \def\tkz@numcc{0}
406 \pgfkeys{
407 /circlecircle/.cd,
408 node/.code = \def\tkz@numcc{0},
409 R/.code = \def\tkz@numcc{1},
410 with nodes/.code = \def\tkz@numcc{2},
411 common/.store in = \tkz@common,
412 common = {},
413 node
414 }
415 %<--------------------------------------------------------------------------–>
416 \def\tkzInterCC{\pgfutil@ifnextchar[{\tkz@InterCC}{\tkz@InterCC[]}}
417 \def\tkz@InterCC[#1](#2,#3)(#4,#5){%
418 \begingroup
419 \pgfqkeys{/circlecircle}{#1}
420 \ifcase\tkz@numcc%
421 % first case 0
422 \tkz@save@length
423 \tkz@@CalcLengthcm(#2,#3){tkz@rayA}
424 \tkz@@CalcLengthcm(#4,#5){tkz@rayB}
425 \tkz@restore@length
426 \tkzInterCCR(#2,\tkz@rayA)(#4,\tkz@rayB){tkzFirstPointResult}{tkzSecondPointResult}
427 \or% 1
428 \tkzInterCCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}%
429 \or%2
430 \tkzInterCCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}
431 \fi
432 \ifx\tkz@common\tkzutil@empty
433 \tkzFindAngle(#2,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an}
434 \ifdim\tkz@an pt<180 pt\relax%
435 \else
436 \pgfnodealias{tkzPointTmp}{tkzSecondPointResult}
437 \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult}
438 \pgfnodealias{tkzFirstPointResult}{tkzPointTmp}
439 \fi
440 \else
441 \tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen}
442 \ifdim\tkz@mathLen pt<0.05pt\relax%
443 \else
444 \pgfnodealias{tkzPointTmp}{tkzSecondPointResult}
445 \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult}
446 \pgfnodealias{tkzFirstPointResult}{tkzPointTmp}
447 \fi
448 \fi
449 \endgroup
450 }
451 %<--------------------------------------------------------------------------–>
452
453 \def\tkzInterCCR(#1,#2)(#3,#4)#5#6{%
454 \begingroup
455 \pgfinterruptboundingbox
456 \tkz@save@length
457 \tkz@@CalcLength(#1,#3){tkz@dd}
458 \tkz@restore@length
459 \pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}}
460 \pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}}
461 \tkz@ax\pgf@x %
462 \tkz@ay\pgf@y %
463 \edef\tkzcax{\strip@pt\tkz@ax}%
464 \edef\tkzcay{\strip@pt\tkz@ay}%
465 \pgfextractx{\pgf@x}{\pgfpointanchor{#3}{center}}
466 \pgfextracty{\pgf@y}{\pgfpointanchor{#3}{center}}
467 \tkz@bx\pgf@x %
468 \tkz@by\pgf@y %
469 \edef\tkzcbx{\strip@pt\tkz@bx}%
470 \edef\tkzcby{\strip@pt\tkz@by}%
471 \tkz@cx#2cm %
472 \tkz@cy#4cm %
473 \edef\tkzccx{\strip@pt\tkz@cx}%
474 \edef\tkzccy{\strip@pt\tkz@cy}%
475 \edef\tkz@aa{\tkz@Dec{((\tkzccx+\tkzccy)/(2*\tkz@dd))*(\tkzccx-(\tkzccy))+\tkz@dd/2}}
476 \edef\tkz@xx{\tkz@Dec{\tkzcax+\tkz@aa/\tkz@dd*(\tkzcbx - (\tkzcax))}}
477 \edef\tkz@yy{\tkz@Dec{\tkzcay+\tkz@aa/\tkz@dd*(\tkzcby - (\tkzcay))}}
478 \path[coordinate](\tkz@xx pt,\tkz@yy pt) coordinate (tkzRadialCenter);
479 \edef\tkz@hh{\tkz@Abs{(\tkzccx+\tkz@aa)*(\tkzccx-(\tkz@aa))}}
480 \edef\tkz@hh{\tkz@Dec{\tkz@Sqrt{\tkz@hh}}}
481 \edef\tkz@rx{\tkz@Dec{\tkz@hh / \tkz@dd * (\tkzcay - (\tkzcby))}}
482 \edef\tkz@ry{\tkz@Dec{\tkz@hh / \tkz@dd * (\tkzcbx - (\tkzcax))}}
483 \edef\tkz@xs{\tkz@Dec{\tkz@xx + \tkz@rx}}
484 \edef\tkz@ys{\tkz@Dec{\tkz@yy + \tkz@ry}}
485 \path[coordinate](\tkz@xs pt,\tkz@ys pt) coordinate (#5);
486 \edef\tkz@xss{\tkz@Dec{\tkz@xx - \tkz@rx}}
487 \edef\tkz@yss{\tkz@Dec{\tkz@yy - \tkz@ry}}
488 \path[coordinate](\tkz@xss pt,\tkz@yss pt) coordinate (#6);
489 \endpgfinterruptboundingbox
490 \endgroup
491 }
492 %<--------------------------------------------------------------------------–>
493 % #2 node #3 node #4 node #5 node
494 % \def\tkzInterCC(#1,#2)(#3,#4)#5#6{%
495 % \begingroup
496 % \tkz@@CalcLength(#1,#2){tkz@rayA}
497 % \tkz@@CalcLength(#3,#4){tkz@rayB}
498 % \tkzInterCCR(#1,\tkz@rayA pt)(#3,\tkz@rayB pt){#5}{#6}
499 % \endgroup
500 % }
501 %<--------------------------------------------------------------------------–>
502 % Intersection de deux cercles Avec deux points
503 %<--------------------------------------------------------------------------–>
504 % la première variante devrait être #2 #3 avec #4 #5
505 \def\tkzInterCCWithNodes(#1,#2,#3)(#4,#5,#6)#7#8{%
506 \begingroup
507 \tkz@@CalcLengthcm(#2,#3){tkz@rayA}
508 \tkz@@CalcLengthcm(#5,#6){tkz@rayB}
509 \tkzInterCCR(#1,\tkz@rayA)(#4,\tkz@rayB){#7}{#8}
510 \endgroup
511 }
512 \makeatother
513 \endinput