home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 November
/
Chip_1999-11_cd.bin
/
ctenari
/
Plavja
/
Exe
/
kuzelosecky.dk
< prev
next >
Wrap
Text File
|
1999-09-02
|
2KB
|
95 lines
// knihovna: KUZELOSECKY.DK
// autor: Petr Plavjanφk
// obsah: funkce pro prßci s ku₧eloseΦkami
// Rytzova konstrukce elipsy zadanΘ sdru₧en²mi pr∙m∞ry
// MN a KL v rovin∞ (Pi nebo Ny)
rytz (Ro, M, N, K, L) {
MN = usecka(M, N);
KL = usecka(K, L);
S = p(MN,KL);
k = kolmice(Ro, MN, S);
M2 = bod(k, S, v(M,S)):1;
d = primka(M2, L);
o = (M2+L)/2;
kr = kruz(Ro, o, v(o,S));
R = p(kr, d);
osa = primka(S,R);
A = bod(osa:0, S, v(R:1, L)):0;
B = bod(osa:1, S, v(R:1, M2)):0;
kdyz(v(A,S) >= v(B,S)) e = elipsa(A, B, S);
jinak e = elipsa(B, A, S);
vrat e;
}
// konstrukce elipsy hlavnφmi vrcholy a jednφm bodem
// v rovin∞ ro (Pi nebo Ny)
prouzkova_konst_elipsy (ro, A, B, M) {
S = (A+B)/2;
h = primka(A,B);
v = kolmice(Pi, h, S);
a = v(A,S);
k = kruz(ro, M, a);
R = p(k, v);
MR = poloprimka(M, R);
X = p(MR, h);
b = v(X, M);
C = bod(v, S, b):0;
vrat elipsa(A, C, S);
}
//platφ i pro hyperbolu
tecna_elipsy_z_bodu(e, M) {
S = e."S";
F = e."F";
G = e."G";
a = e."a";
g1 = kruz(e."ro", F, 2*a);
k = kruz(e."ro", M, v(M,G));
P = p(k, g1);
Q = (P+G)/2;
vrat primka(M, Q);
}
//platφ i pro hyperbolu
tecna_elipsy_smerem(e, s) {
S = e."S";
F = e."F";
G = e."G";
a = e."a";
vr = kruz(e."ro", S, a);
k = kolmice(e."ro", s, m(G,F));
P = p(vr, k);
t = rovnobezka(s, P);
// odstran∞nφ duplicitnφch teΦen
kdyz (t:0 == t:1) vrat m(t:0, t:2);
jinak vrat m(t:0, t:1);
}
tecna_paraboly_z_bodu (p, M) {
o = p."o";
F = p."F";
d = p."d";
k = kruz(p."ro", M, v(M, F));
Q = p(k, d);
q = rovnobezka(o, Q);
T = p(p, q);
vrat primka(M, T);
}
tecna_paraboly_smerem (p, s) {
k = kolmice(s, F);
Q = p(k, d);
q = rovnobezka(o, Q);
T = p(p, q);
vrat rovnobezka(s, T);
}