| 1 |
% ellipticproperties.mp |
| 2 |
% L. Nobre G. |
| 3 |
% 2011 |
| 4 |
|
| 5 |
prologues := 1; |
| 6 |
|
| 7 |
beginfig(1); |
| 8 |
numeric b, k, kt, theta, i, ste, N, aux, cp, cm; |
| 9 |
numeric gamma, gammb, alpha, rhoa, alphb, rhob, fx, fy; |
| 10 |
pair X, Y, A, B, U, L; |
| 11 |
path ell; |
| 12 |
b = 35; |
| 13 |
k = 0.85; |
| 14 |
theta = 30; |
| 15 |
ste = 10; |
| 16 |
N = 5; |
| 17 |
X = k*b*right; |
| 18 |
Y = b*dir(90-theta); |
| 19 |
ell = for i=ste step ste until 360: (X*cosd(i)+Y*sind(i)).. endfor cycle; |
| 20 |
draw ell; |
| 21 |
draw Y--origin--X; |
| 22 |
alpha = 0.5*angle((k**2)-1,2*k*sind(theta)); |
| 23 |
alphb = 0.5*angle(1-(k**2),2*k*sind(-theta)); |
| 24 |
A = X*cosd(alpha)+Y*sind(alpha); |
| 25 |
B = X*cosd(alphb)+Y*sind(alphb); |
| 26 |
draw B--origin--A; |
| 27 |
rhoa = abs(A); |
| 28 |
gamma = angle(A); |
| 29 |
rhob = abs(B); |
| 30 |
gammb = angle(B); |
| 31 |
kt = rhoa/rhob; |
| 32 |
for i=1 upto N: |
| 33 |
aux := rhoa+(i-0.5)*k*b; |
| 34 |
fx := aux*cosd(gamma); |
| 35 |
fy := aux*sind(-gamma); |
| 36 |
cp := (rhob*fx/kt+fy*((fx/kt)++fy+-+rhob))/(((fx/kt)**2)+(fy**2)); |
| 37 |
cm := (rhob*fx/kt-fy*((fx/kt)++fy+-+rhob))/(((fx/kt)**2)+(fy**2)); |
| 38 |
U := A*cm-B*(1+-+cm); |
| 39 |
L := A*cp+B*(1+-+cp); |
| 40 |
draw U--L--(aux,0)--cycle withcolor blue; |
| 41 |
draw 0.5[U,L]; |
| 42 |
endfor; |
| 43 |
endfig; |
| 44 |
|
| 45 |
end. |