vv

14027 Reputation

20 Badges

10 years, 44 days

MaplePrimes Activity


These are replies submitted by vv

The theorem seems to be this:

Let C be a circle of radius 1 and center O.
For each 0 < x <= 1/3 there exists 0 <= d(x) < 1 such that the following holds.

For any circle C' having the radius x and having its center at the distance d(x) from O
and for any point P on C', denote by C(1) the unique circle which is outer-tangent to C' at P and is also inner-tangent to C.
For each k=2..6 define successively the unique (Apollonius) circle C(k) inner-tangent to C, and outer-tangent to C' and C(k-1).
Then C(6) is outer-tangent to C(1).



As the OP noticed, d(1/3)=0 and so, for x=1/3 all the circles C(k) have radius 1/3.
Is the exact expression of d(x) known as a function of x? [it should be]


Note also that the geometry package has a command Apollonius which constructs the Apollonius circles but it fails if their number is not maximal (i.e. 8). (see http://www.mapleprimes.com/questions/205718-Apollonius-geometry-Problem)

I tried to understand the statement of the theorem behind your construction.

Let C and C' be two fixed circles, C' inside C such that radius(C)=1, radius(C')=x, 0<x<=1/3.

Consider n in N and the circles C(1),...,C(n) inside C such that C(k) is tangent to
C, C', C(k+1) and C(k-1) for k=1..n where C(0)=C(n) and C(n+1)=C(1).

Then there exists x such that the existence of such circles is guaranteed. Furthermore,
given P a point on C' and imposing that the tangency point between C(1) and C' is P then n=6 and the positions of the circles C(1),...,C(n) are unique.

Is it correct? Or maybe this is valid only for a special position of center(C').
[Probably the position of center(C') is essential because of the Apollonius construction].

@Carl Love 

Let's say L has 10^5 elements, each of length 10^4 (bytes).
total for L could be 10^9 bytes = 1GB (approx);

After obtaining A, it needs only approx 10^6 bytes = 1MB, and the huge L can be deleted to make room for T.

I did not test the impact for T (in worst situation) but it should be anyway better.

 

 

@Carl Love 

If the expressions in L are huge, the table T in f5 will need much less memory.

The fact L can be replaced by
A := map(addressof,L);

can be tested via
nops(convert(L,set)) = nops(convert(A,set));

 

@emendes 

If your list L and expressions are really huge, I recommend to apply the function not to L but to

map(addressof,L)

because identical expressions will have (in principle) the same memory address.

@Carl Love 

So, f5 is the champion.

@Carl Love 

Strangely, ff with tables seems to be a bit faster than f4
restart;
R:= rand(1..9):
L:= ['R()' $ 99999]:
r1:= CodeTools:-Usage(
     {entries(((x-> x[2])~)~(ListTools:-Classify(x-> x[1], `[]`~(L, [$1..nops(L)]))), nolist)},iterations=10
):
memory used=31.09MiB, alloc change=47.02MiB, cpu time=315.10ms, real time=316.10ms, gc time=63.96ms
f4:= proc(a)
local T, u;
     for  u in `[]`~(a, [$1..nops(a)]) do T[u[1]][u[2]]:= () od;  #use NULL instead of () in math 2D
     {indices}~({entries(T, nolist)}, nolist)
end proc:
CodeTools:-Usage(f4(L),iterations=10):
memory used=22.67MiB, alloc change=0 bytes, cpu time=193.40ms, real time=193.50ms, gc time=51.48ms

fff:=proc(a)
local aa,T,u;
aa:=zip(`[]`,a,[$1..nops(a)]);
for u in aa do T[u[1]][u[2]]:=NULL od;
[indices]~([entries(T, nolist)], nolist)
end:
CodeTools:-Usage(fff(L),iterations=10):
memory used=21.90MiB, alloc change=0 bytes, cpu time=173.20ms, real time=173.90ms, gc time=43.68ms

@Carl Love 

Yes, I know that using tables is faster than appending. The main purpose was simplicity, the speed was just a by-product.

But indeed f4 seems to be both simple and fast, I like it :-)

@asa12 

arctan(x)=-Pi/2 does not have solutions in R or C. [However x=-infinity is an "extended" solution]

@asa12 

tan((45+270)*Pi/180) = -1

L:=seq( [t*cos(t),t*sin(t)],t=0..8.*Pi,Pi/36.):
plot([L],style=point);

 

@asa12 

If you insist in not using polar coordinates, try:

L:=NULL;
kmax:=0; # increase it to see more of the spiral
for ii from 0 by 5 to 365 do
print('ii'=ii);
for k from 0 to kmax do
eq1 := sqrt(x^2 + y^2) - arctan(y,x) = 2*k*Pi;
eq2 := y = evalf((-Pi/4 - ii*Pi/180)/Pi)*(-1.0)*x;
xy := fsolve({eq1, eq2});
#print(xy):
L:=L,eval([x,y],xy);
od:od:
plot([L],style=point);

@acer 

I do not think that it is very useful to use Maple as a funky typewriter. It is very nice that Maple offers the possibility to use true mathematical notations (as in the Physics or DifferentialGeometry packages). But here the mathematics involved is close to 0.

There are so many things to be done mathematically in Maple! For presentations, we have LaTeX, and a better export to it would be nice. The vector 3d graphics should also have a higher priority.

 

@Markiyan Hirnyk 

It is easy to modify convexhull to work properly with irrationals.
I did it, but I don't post here because in the past such code was deleted motivated by copyright.

You forgot with(geometry).

@Markiyan Hirnyk 

First 140 141 142 143 144 145 146 Last Page 142 of 177