summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-euclide/latex/tkzeuclide/tkz-obj-addpoints.tex
blob: 529040ecaf6c98be65565afc7ab5ed60b2472583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
% Copyright 2011 by Alain Matthes
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.


\def\fileversion{1.16 c}
\def\filedate{2011/06/01}   

 
%<--------------------------------------------------------------------------–>
%                   Specific points
%<--------------------------------------------------------------------------–>
%<--------------------------------------------------------------------------–>
%                              barycentre
%<--------------------------------------------------------------------------–>
\def\tkzDefBarycentricPoint(#1){%
 \path[coordinate]  (barycentric cs:#1) coordinate (tkzPointResult); 
} 
\let\tkzDefBCPoint\tkzDefBarycentricPoint
%<--------------------------------------------------------------------------–>
%                      milieu  de deux points   %<--------------------------------------------------------------------------–>
% possible   \coordinate (#3) at ($(#1)!0.5!(#2)$);
%<--------------------------------------------------------------------------–>
\def\tkzDefMidPoint(#1,#2){\path (#1) -- (#2) coordinate[pos=.5](tkzPointResult);}% 
%<--------------------------------------------------------------------------–> 

%<--------------------------------------------------------------------------–> 
%                    OrthoCenter
%<--------------------------------------------------------------------------–>
\def\tkzOrthoCenter(#1,#2,#3){%
     \begingroup
       \tkzUProjection(#1,#2)(#3)\tkzGetPoint{tkz@oca}
       \tkzUProjection(#1,#3)(#2)\tkzGetPoint{tkz@ocb}
       \tkzInterLL(#2,tkz@ocb)(#3,tkz@oca)
     \endgroup
}
%<--------------------------------------------------------------------------–>
%                      GravityCenter
%<--------------------------------------------------------------------------–>
\def\tkzCentroid(#1,#2,#3){%
   \begingroup   
     \tkzDefMidPoint(#3,#2)\tkzGetPoint{tkz@mida}
     \tkzDefMidPoint(#1,#2)\tkzGetPoint{tkz@midb}
     \tkzInterLL(#1,tkz@mida)(#3,tkz@midb)%
   \endgroup
}
%<--------------------------------------------------------------------------–>
%                      CircumCenter
%<--------------------------------------------------------------------------–>
\def\tkzCircumCenter(#1,#2,#3){%
    \begingroup
       \tkzDefMediatorLine(#1,#2)
       \tkzGetPoints{tkz@dir}{tkz@dil}
       \tkzDefMediatorLine(#1,#3)
       \tkzGetPoints{tkz@diir}{tkz@diil} 
       \tkzInterLL(tkz@dir,tkz@dil)(tkz@diir,tkz@diil)%
    \endgroup
} 
%<--------------------------------------------------------------------------–>
%                     InCenter
%<--------------------------------------------------------------------------–>
\def\tkzInCenter(#1,#2,#3){%
\begingroup
  \tkzDefBisectorLine(#3,#1,#2) \tkzGetPoint{tkz@ia}
  \tkzDefBisectorLine(#3,#2,#1)\tkzGetPoint{tkz@ib}
  \tkzInterLL(#1,tkz@ia)(#2,tkz@ib)
\endgroup
} 

%<--------------------------------------------------------------------------–>
%                     EulerCenter
%<--------------------------------------------------------------------------–>
\def\tkzEulerCenter(#1,#2,#3){%
\begingroup
   \tkzCircumCenter(#1,#2,#3)  
   \tkzGetPoint{tkz@ca}
   \tkzOrthoCenter(#1,#2,#3)  
   \tkzGetPoint{tkz@cb} 
   \tkzDefMidPoint(tkz@ca,tkz@cb)
   \tkzDrawPoint(tkzPointResult)  
\endgroup
}
%<--------------------------------------------------------------------------–>
%                     Apollonius center
%<--------------------------------------------------------------------------–>
\def\tkzApolloniusCenter(#1,#2){%
\begingroup
   \tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#1,#2){tkzFirstPointResult}
   \tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#1,#2){tkzSecondPointResult}
   \tkzDefMidPoint(tkzFirstPointResult,tkzSecondPointResult)  
\endgroup
}
%<--------------------------------------------------------------------------–>
%                     Orthogonal center
%<--------------------------------------------------------------------------–>
\def\tkzOrthogonalCenter(#1,#2){%
\begingroup
   \tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#1,#2){tkzFirstPointResult}
   \tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#1,#2){tkzSecondPointResult}
   \tkzDefMidPoint(tkzFirstPointResult,tkzSecondPointResult)  
\endgroup
}
%<--------------------------------------------------------------------------–> 
%                    Internal Similitude center
%<--------------------------------------------------------------------------–>
\def\tkzIntSimilitudeCenter(#1,#2)(#3,#4){%
\begingroup
\path[coordinate]  (barycentric cs:#1=#4,#3=#2) coordinate (tkzPointResult);
\endgroup
}
%<--------------------------------------------------------------------------–> 
%                    External Similitude center
%<--------------------------------------------------------------------------–>
\def\tkzExtSimilitudeCenter(#1,#2)(#3,#4){%
\begingroup
 \path[coordinate]  (barycentric cs:#1=-#4,#3=#2) coordinate (tkzPointResult);
\endgroup
} 
%<--------------------------------------------------------------------------–>
%                            equi points
%<--------------------------------------------------------------------------–>
% draw  ? show ? 


\pgfkeys{
  /tkzEquiPt/.cd,
  from/.code      = {\def\tkz@frompoint{#1}},
  dist/.code      = {\def\tkz@equ@dist{#1}},
  show/.is if     = tkz@equi@show,
  show/.default   = true, 
  /tkzEquiPt/.unknown/.code   = {\let\searchname=\pgfkeyscurrentname
                              \pgfkeysalso{\searchname/.try=#1,
                                   /compass/\searchname/.retry=#1,
                                   /tikz/\searchname/.retry=#1}}  
                                   }

\def\tkzDefEquiPoints{\pgfutil@ifnextchar[{\tkz@DefEquiPoints}{%
                                           \tkz@DefEquiPoints[]}}
\def\tkz@DefEquiPoints[#1](#2,#3){%
\pgfkeys{/tkzEquiPt/.cd,dist = 2,show=false}
\pgfqkeys{/tkzEquiPt}{#1}  
\begingroup
   \tkzProjection(#2,#3)(\tkz@frompoint){tkzEQpoint}
   \tkzVecKNorm[\tkz@equ@dist](tkzEQpoint,#2){tkzFirstPointResult}
   \tkzVecKNorm[-\tkz@equ@dist](tkzEQpoint,#2){tkzSecondPointResult}
       \iftkz@equi@show 
         \tkzCompass[#1](\tkz@frompoint,tkzFirstPointResult)
         \tkzCompass[#1](\tkz@frompoint,tkzSecondPointResult)   
       \fi
\endgroup 
}
  
\endinput


% tkz@equi@show