Caneee315

15 Reputation

3 Badges

5 years, 266 days

MaplePrimes Activity


These are questions asked by Caneee315

with(Maplets[Elements]);

Button("Deduct", Evaluate(f = 'work(3)'))

 

Here I run fucntion 'work()' when click the button. Is there a way to run several functions when I click the same button?

My maplet

mpt := Maplet(Window("Точка выше или ниже прямой",
[[Plotter[f]()], ["1st vector"],
[TextField[v1](), TextField[v2](), TextField[v5]()],
["2nd vector"],
[TextField[v3](), TextField[v4](), TextField[v6]()], ["Скаляр"],
[TextField[scalar]()], [Button("Add", Evaluate(f = 'work(1)'))],
[[ToggleButton['d2']("2D", 'value' = true, 'group' = 'BG1')],
[ToggleButton['d3']("3D", 'value' = false, 'group' = 'BG1')]]]),
ButtonGroup['BG1']())

 

Now I choose via toogle button what to plot 2D or 3D addition but I need to plot it in two different plotter, is there a way to do it?

 

Procedure 

with(Maplets);
with(Elements);
with(Tools);
[AddAttribute, AddContent, Get, ListBoxSplit, Parse, Print, Set, 

  SetTimeout, StartEngine, StopEngine]
with(plots);
with(LinearAlgebra);
with(Student[LinearAlgebra]);

with(Maplets[Elements]);

work:=proc(g)

     local x1, y1, x2, y2, scalar;z1, z2,d2,d3,u,v,U,V,r1,r2,r3,R1,R2,R3,V1:
 x1 := Get(v1::algebraic);
 y1 := Get(v2::algebraic);  

z1 := Get(v5::algebraic);  

x2 := Get(v3::algebraic);  

y2 := Get(v4::algebraic);  

z2 := Get(v6::algebraic);  

scalar := Get(scalar::algebraic);

 d2:= Get(d2);  

d3:= Get(d3);    

 if d2 = true then  u, v:=<x1, y1>, <x2, y2>;  

elif d3 = true then   u, v:=<x1, y1,z1>, <x2, y2,z2>;  

end if;  U:=arrow(u, color=red):  

V:=arrow(u, v, color=black):    

   r1:=u+v: r2:=u-v: r3:=ScalarMultiply(u,scalar):r4:=ScalarMultiply(v,scalar):  

R1:=arrow(r1, color=red):

 R2:=arrow(v, r2, color=black):  

R3:=arrow(r3, color=black):

 R4:=arrow(r4, color=black):  

V1:=arrow(v, color=blue):    

if g = 1 then return VectorSumPlot(u,v, show=1, caption="Треугольник", vectorcolors=[red,blue]);    

end if;  

end proc:

Repeat once again what do I need: I want to plot addition of vectors in 2D and 3D in 2 different plotters at once

I got my maplet and there error occurs when I try to display it - Error, (in Maplets:-Display) BoxCell contains an element (_Maplets_reference_1235) that cannot be placed in a layout.
Please correct Maplet definition.

How to fix it?

with(Maplets[Elements]);

mpt := Maplet(Window("Точка выше или ниже прямой", [[[ToggleButton[TB1]("Tt", 'group' = 'tb1')], [ToggleButton[TB2]("Tt", 'group' = 'tb1')]], ButtonGroup['tb1']()]));

Display(mpt);

with(Maplets);
with(Elements);
with(plots);
with(DocumentTools);

 I use GetProperty("d", value) = "true"  to check if checkbox is checked but it does not work. How can I check if checkbox is checked?

 


workk := proc(g)

if GetProperty("d", value) = "true" then

print("true");

else print("False");

end if;

end proc;

 

 

mpt := Maplet(Window("aaaa", [[Plotter[f]()],

["Scalar", CheckBox[d]()],

[Button("Add", Evaluate(f = 'workk(1)')),

Button("OK", Shutdown())]]));

Display(mpt);
 

I plot addition with VectorSumPlot, is there are a way to do it without this method? And how can I plot multiplication and substraction of vectors?

1 2 Page 1 of 2