|
在 $p:q$ ($p,q\inZ_+$) 的矩形台球桌上,方向 45 度,从角点开始发球,轨迹有多少个自交点?
7:5有12个交点:
import graph;
picture pic;
size(100);
path bill = box((0,0),(7,5));
draw(bill);
pair s = (1e-3,1e-3), db, dt = (1,1), e = s+1e2*dt;
path traj = s--e;
path path = s;
real [] c;
for(int i:sequence(11)) {
c = intersect(bill, traj);
e = point(traj, c[1]);
db = dir(bill, c[0]);
path = path--e;
dt = -dt + 2*dot(dt,db)*db;
s = e;
e = s + 1e2*dt;
for(pair a:intersectionpoints(s+1e-2*dt--e, path)){dot(pic,a,blue);}
traj = (s+dt)--e;
}
draw(path,red);
add(pic);
7:3有6个交点:
import graph;
picture pic;
size(100);
path bill = box((0,0),(7,3));
draw(bill);
pair s = (1e-3,1e-3), db, dt = (1,1), e = s+1e2*dt;
path traj = s--e;
path path = s;
real [] c;
for(int i:sequence(9)) {
c = intersect(bill, traj);
e = point(traj, c[1]);
db = dir(bill, c[0]);
path = path--e;
dt = -dt + 2*dot(dt,db)*db;
s = e;
e = s + 1e2*dt;
for(pair a:intersectionpoints(s+1e-2*dt--e, path)){dot(pic,a,blue);}
traj = (s+dt)--e;
}
draw(path,red);
add(pic);
矩形內部格点数$(p-1)(q-1)$除以2
来自第8页 |
|