|
Revision 4, 3.7 kB
(checked in by jms, 8 months ago)
|
Chargement de jps2ps dans le SVN.
|
| Line | |
|---|
| 1 |
/usegeomD {} def |
|---|
| 2 |
/o {0 0 0} def |
|---|
| 3 |
|
|---|
| 4 |
/Defpoint {defcercle} def |
|---|
| 5 |
|
|---|
| 6 |
%% syntaxe : A A' Vecteur |
|---|
| 7 |
/Vecteur { |
|---|
| 8 |
6 dict begin |
|---|
| 9 |
/z' exch def |
|---|
| 10 |
/y' exch def |
|---|
| 11 |
/x' exch def |
|---|
| 12 |
/z exch def |
|---|
| 13 |
/y exch def |
|---|
| 14 |
/x exch def |
|---|
| 15 |
x' x sub |
|---|
| 16 |
y' y sub |
|---|
| 17 |
z' z sub |
|---|
| 18 |
end |
|---|
| 19 |
} def |
|---|
| 20 |
|
|---|
| 21 |
%% syntaxe u v Addv --> u+v |
|---|
| 22 |
/Addv { |
|---|
| 23 |
6 dict begin |
|---|
| 24 |
/z' exch def |
|---|
| 25 |
/y' exch def |
|---|
| 26 |
/x' exch def |
|---|
| 27 |
/z exch def |
|---|
| 28 |
/y exch def |
|---|
| 29 |
/x exch def |
|---|
| 30 |
x' x add |
|---|
| 31 |
y' y add |
|---|
| 32 |
z' z add |
|---|
| 33 |
end |
|---|
| 34 |
} def |
|---|
| 35 |
|
|---|
| 36 |
%% syntaxe : v alpha Mulv --> alpha u |
|---|
| 37 |
/Mulv { |
|---|
| 38 |
4 dict begin |
|---|
| 39 |
/alpha exch def |
|---|
| 40 |
/z exch def |
|---|
| 41 |
/y exch def |
|---|
| 42 |
/x exch def |
|---|
| 43 |
alpha x mul |
|---|
| 44 |
alpha y mul |
|---|
| 45 |
alpha z mul |
|---|
| 46 |
end |
|---|
| 47 |
} def |
|---|
| 48 |
|
|---|
| 49 |
%% syntaxe : v Norme --> |u| |
|---|
| 50 |
/Norme { |
|---|
| 51 |
3 dict begin |
|---|
| 52 |
/z exch def |
|---|
| 53 |
/y exch def |
|---|
| 54 |
/x exch def |
|---|
| 55 |
x dup mul |
|---|
| 56 |
y dup mul add |
|---|
| 57 |
z dup mul add |
|---|
| 58 |
sqrt |
|---|
| 59 |
end |
|---|
| 60 |
} def |
|---|
| 61 |
|
|---|
| 62 |
/Milieu { |
|---|
| 63 |
6 dict begin |
|---|
| 64 |
/z' exch def |
|---|
| 65 |
/y' exch def |
|---|
| 66 |
/x' exch def |
|---|
| 67 |
/z exch def |
|---|
| 68 |
/y exch def |
|---|
| 69 |
/x exch def |
|---|
| 70 |
x' x add 2 div |
|---|
| 71 |
y' y add 2 div |
|---|
| 72 |
z' z add 2 div |
|---|
| 73 |
end |
|---|
| 74 |
} def |
|---|
| 75 |
|
|---|
| 76 |
/angle_I -135 def |
|---|
| 77 |
/angle_J -5 def |
|---|
| 78 |
/coeff_vect_I 1 def |
|---|
| 79 |
/coeff_vect_J 1 def |
|---|
| 80 |
|
|---|
| 81 |
/vect_I {angle_I cos angle_I sin coeff_vect_I mulv} def |
|---|
| 82 |
/vect_J {angle_J cos angle_J sin coeff_vect_J mulv} def |
|---|
| 83 |
/vect_K {0 1} def |
|---|
| 84 |
|
|---|
| 85 |
/xyz2xy { |
|---|
| 86 |
3 dict begin |
|---|
| 87 |
/z exch def |
|---|
| 88 |
/y exch def |
|---|
| 89 |
/x exch def |
|---|
| 90 |
vect_I x mulv |
|---|
| 91 |
vect_J y mulv |
|---|
| 92 |
vect_K z mulv |
|---|
| 93 |
addv addv |
|---|
| 94 |
end |
|---|
| 95 |
} def |
|---|
| 96 |
|
|---|
| 97 |
/projxy { |
|---|
| 98 |
pop 0 |
|---|
| 99 |
} def |
|---|
| 100 |
|
|---|
| 101 |
/projxz { |
|---|
| 102 |
3 dict begin |
|---|
| 103 |
/z exch def |
|---|
| 104 |
/y exch def |
|---|
| 105 |
/x exch def |
|---|
| 106 |
x 0 z |
|---|
| 107 |
end |
|---|
| 108 |
} def |
|---|
| 109 |
|
|---|
| 110 |
/projyz { |
|---|
| 111 |
3 dict begin |
|---|
| 112 |
/z exch def |
|---|
| 113 |
/y exch def |
|---|
| 114 |
/x exch def |
|---|
| 115 |
0 y z |
|---|
| 116 |
end |
|---|
| 117 |
} def |
|---|
| 118 |
|
|---|
| 119 |
/projOy { |
|---|
| 120 |
3 dict begin |
|---|
| 121 |
/z exch def |
|---|
| 122 |
/y exch def |
|---|
| 123 |
/x exch def |
|---|
| 124 |
0 y 0 |
|---|
| 125 |
end |
|---|
| 126 |
} def |
|---|
| 127 |
|
|---|
| 128 |
/projOx { |
|---|
| 129 |
3 dict begin |
|---|
| 130 |
/z exch def |
|---|
| 131 |
/y exch def |
|---|
| 132 |
/x exch def |
|---|
| 133 |
x 0 0 |
|---|
| 134 |
end |
|---|
| 135 |
} def |
|---|
| 136 |
|
|---|
| 137 |
/projOz { |
|---|
| 138 |
3 dict begin |
|---|
| 139 |
/z exch def |
|---|
| 140 |
/y exch def |
|---|
| 141 |
/x exch def |
|---|
| 142 |
0 0 z |
|---|
| 143 |
end |
|---|
| 144 |
} def |
|---|
| 145 |
|
|---|
| 146 |
/Xtick { |
|---|
| 147 |
1 dict begin |
|---|
| 148 |
/x exch def |
|---|
| 149 |
[x -.1 0 x .1 0] {xyz2xy} capply ligne |
|---|
| 150 |
end |
|---|
| 151 |
} def |
|---|
| 152 |
|
|---|
| 153 |
/Ytick { |
|---|
| 154 |
1 dict begin |
|---|
| 155 |
/y exch def |
|---|
| 156 |
[-.1 y 0 .1 y 0] {xyz2xy} capply ligne |
|---|
| 157 |
end |
|---|
| 158 |
} def |
|---|
| 159 |
|
|---|
| 160 |
/Ztick { |
|---|
| 161 |
1 dict begin |
|---|
| 162 |
/z exch def |
|---|
| 163 |
[0 -.1 z 0 .1 z] {xyz2xy} capply ligne |
|---|
| 164 |
end |
|---|
| 165 |
} def |
|---|
| 166 |
|
|---|
| 167 |
/arrowscale {.5 dup} def |
|---|
| 168 |
|
|---|
| 169 |
/OXarrow { |
|---|
| 170 |
gsave |
|---|
| 171 |
IM stranslate |
|---|
| 172 |
O I angle rotate |
|---|
| 173 |
arrow |
|---|
| 174 |
grestore |
|---|
| 175 |
} def |
|---|
| 176 |
|
|---|
| 177 |
/OYarrow { |
|---|
| 178 |
gsave |
|---|
| 179 |
JM stranslate |
|---|
| 180 |
O J angle rotate |
|---|
| 181 |
arrow |
|---|
| 182 |
grestore |
|---|
| 183 |
} def |
|---|
| 184 |
|
|---|
| 185 |
/OZarrow { |
|---|
| 186 |
gsave |
|---|
| 187 |
KM stranslate |
|---|
| 188 |
O K angle rotate |
|---|
| 189 |
arrow |
|---|
| 190 |
grestore |
|---|
| 191 |
} def |
|---|
| 192 |
|
|---|
| 193 |
/Xmark { |
|---|
| 194 |
gsave |
|---|
| 195 |
1 dict begin |
|---|
| 196 |
/t exch def |
|---|
| 197 |
t Xtick |
|---|
| 198 |
setCourrier |
|---|
| 199 |
t ch cvs t 0 0 xyz2xy (-2 1) bltext |
|---|
| 200 |
end |
|---|
| 201 |
grestore |
|---|
| 202 |
} def |
|---|
| 203 |
|
|---|
| 204 |
/Ymark { |
|---|
| 205 |
gsave |
|---|
| 206 |
1 dict begin |
|---|
| 207 |
/t exch def |
|---|
| 208 |
t Ytick |
|---|
| 209 |
setCourrier |
|---|
| 210 |
t ch cvs 0 t 0 xyz2xy urtext |
|---|
| 211 |
end |
|---|
| 212 |
grestore |
|---|
| 213 |
} def |
|---|
| 214 |
|
|---|
| 215 |
/Zmark { |
|---|
| 216 |
gsave |
|---|
| 217 |
1 dict begin |
|---|
| 218 |
/t exch def |
|---|
| 219 |
t Ztick |
|---|
| 220 |
setCourrier |
|---|
| 221 |
t ch cvs 0 0 t xyz2xy (-2 0) bltext |
|---|
| 222 |
end |
|---|
| 223 |
grestore |
|---|
| 224 |
} def |
|---|
| 225 |
|
|---|
| 226 |
|
|---|
| 227 |
/largeur_repere 5 def |
|---|
| 228 |
/Longueur_repere 10 def |
|---|
| 229 |
|
|---|
| 230 |
/Tracerepere1 { |
|---|
| 231 |
18 dict begin |
|---|
| 232 |
gsave |
|---|
| 233 |
/i {1 0 0} def |
|---|
| 234 |
/j {0 1 0} def |
|---|
| 235 |
/k {0 0 1} def |
|---|
| 236 |
/a {-1 -1 0} def |
|---|
| 237 |
/b {-1 Longueur_repere 0} def |
|---|
| 238 |
/c {largeur_repere Longueur_repere 0} def |
|---|
| 239 |
/d {largeur_repere -1 0} def |
|---|
| 240 |
|
|---|
| 241 |
[/I /J /K /A /B /C /D] |
|---|
| 242 |
[i j k a b c d] {xyz2xy} capply |
|---|
| 243 |
mapnp |
|---|
| 244 |
|
|---|
| 245 |
O I A B interdroite O 1.2 hompoint /Im defpoint |
|---|
| 246 |
O I C D interdroite O 1.2 hompoint /IM defpoint |
|---|
| 247 |
O J A D interdroite O 1.2 hompoint /Jm defpoint |
|---|
| 248 |
O J C B interdroite O 1.1 hompoint /JM defpoint |
|---|
| 249 |
/KM {0 ymax} def |
|---|
| 250 |
-2 O K ydpoint /Km defpoint |
|---|
| 251 |
|
|---|
| 252 |
2 setlinewidth |
|---|
| 253 |
[B C D] ligne |
|---|
| 254 |
.8 setlinewidth |
|---|
| 255 |
[B A D] ligne |
|---|
| 256 |
|
|---|
| 257 |
1 setlinewidth |
|---|
| 258 |
[Im IM] ligne |
|---|
| 259 |
[Jm JM] ligne |
|---|
| 260 |
[O KM] ligne |
|---|
| 261 |
|
|---|
| 262 |
OXarrow |
|---|
| 263 |
OYarrow |
|---|
| 264 |
OZarrow |
|---|
| 265 |
|
|---|
| 266 |
.8 setlinewidth |
|---|
| 267 |
gsave |
|---|
| 268 |
pointilles |
|---|
| 269 |
[Km O] ligne |
|---|
| 270 |
grestore |
|---|
| 271 |
|
|---|
| 272 |
[1] |
|---|
| 273 |
dup {Xtick} apply |
|---|
| 274 |
{Xmark} apply |
|---|
| 275 |
[1] |
|---|
| 276 |
dup {Ytick} apply |
|---|
| 277 |
{Ymark} apply |
|---|
| 278 |
[1] |
|---|
| 279 |
dup {Ztick} apply |
|---|
| 280 |
{Zmark} apply |
|---|
| 281 |
|
|---|
| 282 |
setTimesItalic |
|---|
| 283 |
(x) IM (5 0) brtext |
|---|
| 284 |
(y) JM (0 -2) dltext |
|---|
| 285 |
(z) KM drtext |
|---|
| 286 |
grestore |
|---|
| 287 |
end |
|---|
| 288 |
} def |
|---|
| 289 |
|
|---|