Message Boards Message Boards

0
|
4408 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Updating Show after Manipulating

Posted 9 years ago

Manipulate[p1 = {1, 4, 7 + a}, {a, 0, 5}] p2 = {1, 3, 3}; p3 = {0, 4, 6};

p1p2Vector = p2 - p1;
p1p3Vector = p3 - p1;

points = Graphics3D[{PointSize[Large], Point[{p1, p2, p3}]}];
p1p2VectorG = Graphics3D[{Red, Arrow[{p1, p1 + p1p2Vector}]}];
p1p3VectorG = Graphics3D[{Blue, Arrow[{p1, p1 + p1p3Vector}]}];

Show[points, p1p2VectorG, p1p3VectorG]

I am trying to figureout how to update the Show command after I have manipulated my program. Please keep in mind I am new to Mathematica.

POSTED BY: Colby Fehring
2 Replies
Posted 9 years ago

Thanks! This had me stumped for a few hours. :)

POSTED BY: Colby Fehring

The layout for Manipulate is this: Manipulate[code;code; someOutput, slider1,slider2,slider3]

So you need to put the final output inside Manipulate, not outside. Like this

Manipulate[
 p2 = {1, 3, 3};
 p3 = {0, 4, 6};
 p1p2Vector = p2 - p1;
 p1p3Vector = p3 - p1;
 points = Graphics3D[{PointSize[Large], Point[{p1, p2, p3}]}]; 
 p1p2VectorG = Graphics3D[{Red, Arrow[{p1, p1 + p1p2Vector}]}];
 p1p3VectorG = Graphics3D[{Blue, Arrow[{p1, p1 + p1p3Vector}]}];
 p1 = {1, 4, 7 + a};
 Show[points, p1p2VectorG, p1p3VectorG]
 , {a, 0, 5}]

enter image description here

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract