Message Boards Message Boards

0
|
5223 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to solve...

Posted 12 years ago
Hey,

I'm sitting on a Mathamatica program where I have to screen a vector on a plane.
So now my problem is, that I have to put a Manipulate command in it where I can change the coordinates of the vector and the plane.
I think the solution must be really easy, but I can't figure it out,
That's my solution so far:
 u0 = 0; u1 = 4; u2 = 7; u3 = 3;
 u = {u0, u1, u2, u3};
 
 n = {u1, u2, u3};
 
 anf = -10; end = -anf;
 
 gf1 = ContourPlot3D[{1, x, y, z}.u == 0, {x, anf, end}, {y, anf,
 end}, {z, anf, end}, Boxed -> False, AxesOrigin -> {0, 0, 0},
AxesLabel -> {"x", "y", "z"}, ContourStyle -> {Blue, Opacity[0.4]}];



q = 2;
s = {2, 2, 2} ; r = {5, 7, 9} ;
v = s + q*(r - s) // MatrixForm; (*3D-Vekotr*)

c = Graphics3D[{Red, Arrow[{s, r}]}];

(* Projektionsstrahl *)

f1 = r - k*n;

gf3 = ParametricPlot3D[f1, {k, 0, 2}, PlotStyle -> {Green, Thick}];


f2 = s - j*n;

gf4 = ParametricPlot3D[f2, {j, 0, 2}, PlotStyle -> {Green, Thick}];

x1 = r[[1]] - k*u1;
y1 = r[[2]] - k*u2;
z1 = r[[3]] - k*u3;
sol1 = Solve[u1 x1 + u2 y1 + u3 z1 == u0, k];
k1 = k /. sol1[[1]];

dp1 = r - k1*n;


x2 = s[[1]] - j*u1;
y2 = s[[2]] - j*u2;
z2 = s[[3]] - j*u3;
sol2 = Solve[u1 x2 + u2 y2 + u3 z2 == u0, j];
j1 = j /. sol2[[1]];
dp2 = s - j1*n;


p = dp2 - dp1

gf5 = Graphics3D[{Red, Thick, Arrow[{dp2, dp1}]}];


l = EuclideanDistance[dp2, dp1] // N;



Show[{gf1, c, gf3, gf4, gf5}, Axes -> True, Boxed -> False,
AxesLabel -> {"x", "y", "z"}, AxesOrigin -> {0, 0, 0}]

I want to have u={u0, u1, u2, u3} and the vector v = s + q*(r - s) in the Manipulate command.
Please help me!

Thanks and Cheers
Linda
POSTED BY: Linda Helm
What code you have already is nearly a drop-in to this
Manipulate[
(*u0=0;u1=4;u2=7;u3=3;*)
<<code>>,
{{u0, 0}, -10, 10},
{{u1, 4}, -10, 10},
{{u2, 7}, -10, 10},
{{u3, 3}, -10, 10}
]
Changes are:
remove
u0=0;u1=4;u2=7;u3=3;
supress
p = dp2 - dp1;
Notice, this example does not do anything for your MatrixForm symbol v.
Also notice, the Red Arrow symbol c will move the opposite direction of your projection plane gf1 with u0 != 0.
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