Kitonum

21860 Reputation

26 Badges

17 years, 239 days

MaplePrimes Activity


These are replies submitted by Kitonum

@usmanafzal  Unfortunately, I can not help anything, because I did not install this package. Try to contact the technical service Maplesoft.

This is even a simpler task than  http://www.mapleprimes.com/questions/221383-How-Do-To-Inscribed-Cone-In-Sphere--In-Maple

You must submit the text of your code instead of the picture and / or load the worksheet.

@Jalale  If you initialize this procedure in Maple and click on the plot, the animation panel will appear and on it you will see a slider that can move by the mouse.

 

 

 

@Jalale  I think you mean a procedure whose parameter will be the properties of the inscribed cone. The procedure  ConeInSphere  solves the problem. The height of the cone  h  is a required parameter. This can be any number from the range  0 .. 2.  Cone and Sphere are optional parameters. They set the graphical options for the cone and sphere.

ConeInSphere:=proc(h::numeric, Cone::list:=[style=surface, color="Green"], Sphere::list:=[color=pink, transparency=0.5])
local R, A, B, C;
uses plottools, plots;
R:=sqrt(1-(h-1)^2);
A:=plot3d([r*cos(t),r*sin(t),1-h], r=0..R, t=0..2*Pi, op(Cone)):  
# The base of the cone
B:=plot3d([r*cos(t),r*sin(t),-h/R*r+1], r=0..R, t=0..2*Pi,op(Cone)): # Lateral surface of the cone
C:=plottools:-sphere(op(Sphere)):
plots:-display(A, B, C, axes=normal, view=[-1.2..1.2,-1.2..1.2, -1.2..1.4], scaling=constrained);
end proc:

 

Example of use:

ConeInSphere(1.2, [style=surface, color="Cyan"], [color="Yellow", transparency=0.7]);

 

Example of an animation by using this procedure:

P:=h->ConeInSphere(h, [style=surface, color="Cyan"], [color="Yellow", transparency=0.7]):
plots:-animate(P, [h], h=2..0, frames=90, paraminfo=false);

                   

Edit.

 




 

@mehdibaghaee   Your system already has objects with names  A  and  b . I changed the names for the matrix of the system and its right side. Now everything is all right.

soal_new.mw

@nk2016 

eq:=diff(y(x),x)=sqrt(1+a*x+2*y(x)):
eval(eq, y(x)=-(1/2)*a*x+(1/8)*a^2-1/2);
is(%) assuming a<0;
A:=eval(eq, y(x)=m*x+c);
solve(coeff(op([2,1],%), x), m);
eval(A, m=%);
solve(%, c);

 

@taro  Because  this is a recursive procedure. If you put a semicolon instead of a comma in the example  P(A)  the procedure returns NULL. Every procedure returns only the last expression which is ending with a semicolon.

See this a toy example:

Proc:=proc(a,b)
a; b;
end proc:

Proc(1, 2);

                                        2

 

@Stupid Student  I do not use  Spread  package, but I looked out Help on it and did not find a possibility of programmatically control cell color. I think  DocumentTools:-Tabulate  might be a good replacement for spreadsheets.

@Ronan  I think the cause of the problem with transform  is 2d math,  which is very buggy. In 1d math everything is OK.

 

Anim_How-3new.mw

@Derein 

restart;
a:=0: b:=1.6: c:=4: d:=4.4:
f:=convert(abs(x-b)+abs(a-x)+abs(x-a)+abs(d-x)+abs(b-d), fraction):
m:=minimize(f, x=0..convert(d, fraction));  
# Minimum of the function  f
solve(f=m, x);
 # All values of variable x, that  f=m

                                            m := 44/5
                                      RealRange(0, 8/5)

@Zeineb  In your code 3 errors. Should be

with(DEtools):
DEtools:-DEplot(diff(x(t), t)-x(t), x(t), t = -1 .. 1, {x(0) = 1});

 

Just copy it to your worksheet and run.

@alyresa  If you want to direct the prism axis (from my answer above) along the vector (1,1,1), you can use the rotation transformation:

f:=piecewise(x>-1 and x<-1/2,sqrt(3)*(x+1),x>=-1/2 and x<=1/2,sqrt(3)/2,x>1/2,-sqrt(3)*(x-1)):
A:=plot3d(2, x=-1..1, y=-f..f, style=surface, color=khaki, filled):
with(plots): with(plottools): with(LinearAlgebra):
v1:=<1,1,1>: v2:=<0,0,1>:
v:=v1 &x v2;  
# The axis of rotation
phi:=arccos(v1.v2/Norm(v1,2)/Norm(v2,2));  # The angle of rotation
display(rotate(A, -phi, [[0,0,0],convert(v,list)]), axes=normal);

                  

 

 

@Derein   abs(x-b)  is the distance between the points  b  and  xabs(a-x)  is the distance between the points  a  and  x  and so on. So we get all the distance covered, that is  abs(x-b)+abs(a-x)+abs(x-a)+abs(d-x)+abs(b-d). This is a function of the variable x . The command  minimize  finds the minimum of this function if  x  changes in the range  0 .. 4.4 . The problem has not the unique solution. The minimum equal to  8.8  and is achieved for all  x  in the range  0 .. 1.6

First 68 69 70 71 72 73 74 Last Page 70 of 134