Skip to main content
added 106 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

I need to create a ManipulateManipulate that shows a circle or disk with a control to select whether it is CircleCircle or DiskDisk and sliders to set the {x,y}{x,y} coordinates, radius and color (HueHue).

My code is

type={"Disk","Circle"};

Manipulate[ip=Position[typeManipulate[ip = Position[type,choose];If[ip==choose];
  If[ip == {{2}}, Show[Graphics[{Hue[a], Circle[{x, y}, r]}], 
    Axes->True, PlotRange -> {{-5,5}, {-5,5}}],If[ip==
  If[ip == {{1}}, Show[Graphics[{Hue[a], Disk[{x, y}, r]}], 
    Axes ->True> True, PlotRange -> {{-5, 5}, {-5, 5}}], Print["No Plot"]]], 
 {choose, type, ControlType ->PopupMenu> PopupMenu}, 
 {a, -1, 1}, {x, -4, 5}, {y, -4, 5}, {r, 1, 5}]

However, on selecting circle it keeps on loading again and again. I am not able to find the error. What is wrong with this code.

I need to create a Manipulate that shows a circle or disk with a control to select whether it is Circle or Disk and sliders to set the {x,y} coordinates, radius and color (Hue).

My code is

type={"Disk","Circle"};

Manipulate[ip=Position[type,choose];If[ip=={{2}},Show[Graphics[{Hue[a],Circle[{x,y},r]}],Axes->True,PlotRange->{{-5,5},{-5,5}}],If[ip=={{1}},Show[Graphics[{Hue[a],Disk[{x,y},r]}],Axes->True,PlotRange->{{-5,5},{-5,5}}],Print["No Plot"]]],{choose,type,ControlType->PopupMenu},{a,-1,1},{x,-4,5},{y,-4,5},{r,1,5}]

However, on selecting circle it keeps on loading again and again. I am not able to find the error. What is wrong with this code.

I need to create a Manipulate that shows a circle or disk with a control to select whether it is Circle or Disk and sliders to set the {x,y} coordinates, radius and color (Hue).

My code is

type={"Disk","Circle"};

Manipulate[ip = Position[type,choose];
  If[ip == {{2}}, Show[Graphics[{Hue[a], Circle[{x, y}, r]}], 
    Axes->True, PlotRange -> {{-5,5}, {-5,5}}],
  If[ip == {{1}}, Show[Graphics[{Hue[a], Disk[{x, y}, r]}], 
    Axes -> True, PlotRange -> {{-5, 5}, {-5, 5}}], Print["No Plot"]]], 
 {choose, type, ControlType -> PopupMenu}, 
 {a, -1, 1}, {x, -4, 5}, {y, -4, 5}, {r, 1, 5}]

However, on selecting circle it keeps on loading again and again. I am not able to find the error. What is wrong with this code.

Source Link

Create a Manipulate with a control to select Circle or Disk

I need to create a Manipulate that shows a circle or disk with a control to select whether it is Circle or Disk and sliders to set the {x,y} coordinates, radius and color (Hue).

My code is

type={"Disk","Circle"};

Manipulate[ip=Position[type,choose];If[ip=={{2}},Show[Graphics[{Hue[a],Circle[{x,y},r]}],Axes->True,PlotRange->{{-5,5},{-5,5}}],If[ip=={{1}},Show[Graphics[{Hue[a],Disk[{x,y},r]}],Axes->True,PlotRange->{{-5,5},{-5,5}}],Print["No Plot"]]],{choose,type,ControlType->PopupMenu},{a,-1,1},{x,-4,5},{y,-4,5},{r,1,5}]

However, on selecting circle it keeps on loading again and again. I am not able to find the error. What is wrong with this code.