Message Boards Message Boards

Avoid error with the coordinate of a plot?

GROUPS:

Hi guys. I don't understand why I get this error: "Coordinate {10, 8, 3, 1} should be a triple of numbers, or a Scaled form."

T[x_, y_, z_] := {{1, 0, 0, x}, {0, 1, 0, y}, {0, 0, 1, z}, {0, 0, 0, 1}};
Rx[α_] := {{1, 0, 0, 0}, {0, Cos[α], -Sin[α], 0}, {0, Sin[α], Cos[α], 0}, {0, 0, 0, 1}}
Ry[α_] := {{Cos[α], 0, Sin[α], 0}, {0, 1, 0, 0}, {-Sin[α], 0, Cos[α], 0}, {0, 0, 0, 1}}
Rz[α_] := {{Cos[α], -Sin[α], 0, 0}, {Sin[α], Cos[α], 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}

T01 = T[x0, 0, 0].Rz[α0]; MatrixForm[T01]
T12 = T[0, 0, z1].Rz[θ1]; MatrixForm[T12]
T23 = T[-a1, 0, 0].Ry[-θ2]; MatrixForm[T23]
T34 = T[L1, 0, 0].Ry[π - θ3]; MatrixForm[T34]
T45 = T[L2, 0, 0]; MatrixForm[T45]
T05 = FullSimplify[T01.T12.T23.T34.T45]; MatrixForm[T05]

O1 = T01.{0, 0, 0, 1}; O1 = O1[[1 ;; 3]];
O2 = T01.T12.{0, 0, 0, 1}; O2 = O2[[1 ;; 3]];
O3 = T01.T12.T23.{0, 0, 0, 1}; O3 = O3[[1 ;; 3]];
O4 = T01.T12.T23.T34.{0, 0, 0, 1}; O4 = O4[[1 ;; 3]];
O5 = FullSimplify[T01.T12.T23.T34.T45.{0, 0, 0, 1}]; O5 = O5[[1 ;; 3]];

Manipulate[
 Block[
  {x0 = 10, z1 = 3, a1 = 2, α0 = π/2, L1 = 30, 
   L2 = 20, θ1 = q1, θ2 = q2, θ3 = q3}, 
  Graphics3D[{Red, Thick, Line[{O1, O2, O3, O4, O5}], LightBlue, 
    Cuboid[{0, 0, 0}, {0, 30, 40}], LightGray, 
    Cuboid[{0, 0, 0}, {10, 30, 0}]} , 
   PlotRange -> {{0, 10}, {0, 30}, {0, 40} }]
  ], 
 {{q1, 0}, -π, π}, {q2, 0, 3π/4}, {q3, 0, π}
 ]

I guess the problem comes from the origins O1,O2, etc. Could you help me?

POSTED BY: Lorenzo Cristofori
Answer
7 days ago

I don't get any error. Try quitting the kernel and re-execute your code. Perhaps something has the wrong definition lurking in memory.

POSTED BY: Michael Rogers
Answer
7 days ago

Your code above (not the notebook) works fine on my system Mma 7.0

POSTED BY: Hans Dolhaine
Answer
6 days ago

I tried but I keep getting this error. I attach the Notebook of the code. I have the same error in all the plot of the notebook.

Attachments:
POSTED BY: Lorenzo Cristofori
Answer
7 days ago

Update. I tried to quit the Kernel, but the situation is the same. I'm using Mathematica 11.2 if it helps.

Maybe I'm doing something wrong running the code. I do " Evalutate Notebook" to see the output and I still get the same error. But it's like O1, O2, ... , O5 aren't read. Since if I go in O5 and I press MAIUSC + ENTER the plots works.

POSTED BY: Lorenzo Cristofori
Answer
6 days ago

It seems that your CinematicaInversa goes wrong. See notebook. And I think you should use Map instead of Apply in the last statement. That is for a first suggestion because I have to leave now.

Attachments:
POSTED BY: Hans Dolhaine
Answer
6 days ago

Group Abstract Group Abstract