Kitonum

20084 Reputation

26 Badges

17 years, 24 days

MaplePrimes Activity


These are replies submitted by Kitonum

You forgot to call  plots  package in the last 3 lines of the code.

@vv  Thank you for the amendment. Of course the name of the procedure  FrechetDistance  is misleading. I changed it to  d .

@deniscr  In Maple 2018.1 it works properly. See file

dot_product.mw

In Maple 2017.3 it works also.

@digerdiga  

1. You specified formulas for the mapping r = sqrt (x * y) , t = ln (sqrt (x / y)), but did not specify on which set this mapping is defined. For example, it is clear that this set can not be a square  [0,1] x [0,1].

2. No.

3. Let's finish this rather meaningless conversation.

@digerdiga  You wrote "Are you sure? Because the mapping  r=sqrt(x*y), t=ln(sqrt(x/y))

seems fine to me..."

In the definition of a function  f: X -> Y , it is important not only the rule that each x of X is associated with some y of Y, but also the sets X and Y themselves. For the existence of an inverse function the correspondence between sets must be one-to-one ... Read carefully my previous comment.

@nm  See the first paragraph in help:

"discont returns a set of values where it is possible (not necessarily certain) that discontinuities occur."

Similarly:

discont(sqrt(1-x^2), x);
                                           
 {-1, 1}


 

@digerdiga 

1. Under the mapping  (x,y) -> (x*exp(y), x*exp(-y))  the straight lines  x=const<>0 are mapped onto hyperbolas and if  x=0  into one point  (0,0) . The straight lines  y=const  are mapped onto lines that pass through the origin.
Maple makes a bug when mapping a filled square.

2. There is no inverse mapping to the mapping  (x,y) -> (x*exp(y), x*exp(-y))  on the square  [0,1] x [0,1]   , because it is not one-to-one.

3. You wrote "Is there something like linspace(0,1,10) ? using seq([x, t, t = 0 .. 1], x = 0.1e-1 .. 1, 0.5e-1) does not have the other endpoint at 1, because the intervals do not match up to 1."  I did not understand the meaning of this phrase.

@digerdiga  1. Yes you are right. F(S) is enough.

2. Here is my first option:
restart;
S:=plottools:-rectangle([0,1],[1,0], color=red):
f:=(r,t)->[r*exp(t),r*exp(-t)];
F:=plottools:-transform(f):
plots:-display(F(S), scaling=constrained);

 

Maple incorrectly represents one side of a triangle as a straight line, it is easy to verify that it is not straight. 

3. When you write  x=r*exp(t), y=r*exp(-t), it means that  x  and  y  are just the coordinates of the point at which the point  (r,t)  maps under the indicated mapping. Instead  x  and  y , you can write for example  u  and  v  that does not change the point. In order to avoid misunderstandings, it is better to write so  (x,y) -> (x*exp(y), x*exp(-y))

@digerdiga  I first tried another option where it was necessary. Now everything is fixed.

@brian bovril  Unit cubes which lie entirely within the sphere, opaque (edges and faces), and those which are only partially shown only edges. Now directly in the picture you can count the numbers  N  and  n .

restart;
VisOnion:=proc(R::positive)
local R0, N, n, x, y, z, a, b, S;
uses plottools, plots;
R0:=`if`(R::integer,R-1,floor(R));
N:=0; n:=0;
for x from 0 to R0 do
for y from 0 to R0 do
for z from 0 to R0 do
if x^2+y^2+z^2<R^2 then N:=N+1; a[N]:=cuboid([x,y,z],[x+1,y+1,z+1], style=line, color=red);
if (x+1)^2+(y+1)^2+(z+1)^2<=R^2 then n:=n+1; b[n]:=cuboid([x,y,z],[x+1,y+1,z+1], color=yellow);
fi; fi;
od: od: od:
a:=convert(a,list); b:=convert(b,list);
S:=sphere(R, transparency=0.7);
display(a[], b[], S, axes=none, view=[(0..R+1)$3]);
end proc:

   
Example:

VisOnion(3);
 

                         

Addition. The number of incomplete cubes is easier to count, if you just draw lines of cuts on an opaque sphere:

restart;
Cuts:=proc(R::positive)
local R0, Sx, Sy, Sz, S;
uses plottools, plots;
R0:=`if`(R::integer,R-1,floor(R));
Sx:=seq(spacecurve([x,sqrt(R^2-x^2)*cos(t),sqrt(R^2-x^2)*sin(t)], t=0..Pi/2, color=red, thickness=3), x=0..R0);
Sy:=seq(spacecurve([sqrt(R^2-y^2)*cos(t),y,sqrt(R^2-y^2)*sin(t)], t=0..Pi/2, color=red, thickness=3), y=0..R0);
Sz:=seq(spacecurve([sqrt(R^2-z^2)*cos(t),sqrt(R^2-z^2)*sin(t),z], t=0..Pi/2, color=red, thickness=3), z=0..R0);
S:=sphere(R, style=surface, color=yellow);
display(Sx, Sy, Sz, S, axes=none, view=[(0..R+1)$3]);
end proc:

Cuts(3); 

                              

I did not understand what your problem is.

@Kitonum   In the first octant  (x>=0, y>=0, z>=0)  we associate with each point with integer coordinates the cube, for which this point from all its vertices is closest to the origin. It is easy to verify that this correspondence is one-to-one.

@acer  For  sqrt  it's OK, but unfortunately for  ln  this method leads to error:

restart;
solve( evalc(Im(ln(x))), {x} );
ln(0);
                                          
{0 <= x}
Error, (in ln) numeric exception: division by zero
 

@nm  I do not know an universal way to automatically solve this problem (finding of a domain). We could write a procedure for this  if Maple solved the problem even for the simplest elementary functions. For example, here are my attempts to find the domain for the function  sqrt  (the answer is obvious  x>=0):

restart;
solve(Im(sqrt(x))=0, x);
allvalues(%);
solve(sqrt(x)<0 or sqrt(x)>=0);
RealDomain:-solve(sqrt(x)<0 or sqrt(x)>=0);
solve(sqrt(x)<0 or sqrt(x)>=0) assuming real;   


 

@SGJanssens   M^(-1)

First 36 37 38 39 40 41 42 Last Page 38 of 126