Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.8K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to input a rotated vector?

Posted 11 years ago
POSTED BY: Alan Smith
5 Replies
Posted 11 years ago
POSTED BY: David Keith
Posted 11 years ago

Thanks David, but in 1) I wanted to know how to look at similar matrices to the rotation matrix as well? I tried Clear[y], got the same result. I note that even when I start a new notebook, it seems to keep previous values - is there a clear all that will guarantee nothing left over from previous work? Cheers ALan

POSTED BY: Alan Smith
Posted 11 years ago

Hi Alan,

On 1: What you have written is correct. Which is the same syntax you see in Out[1]: above. All RotationMatrix has done is generate a matrix, which in Mathematica is just a list of lists. You've done the same thing.

On 2: It appears to me that you have previously assigned to y the value Sqrt[1-x^2]. Try executing Clear[y] and evaluate it again.

Best, David

POSTED BY: David Keith
Posted 11 years ago

Thanks David.

1) r = RotationMatrix[theta] worked fine. If I wanted to try different matrices, for example {{Cos[theta], Sin[theta]}, {-Sin[theta], Cos[theta]}} how would I do that?

2) When I input r.{x, y} I got out[55]= {x Cos[theta] - Sqrt[1 - x^2] Sin[theta], Sqrt[1 - x^2] Cos[theta] + x Sin[theta]}

Not sure whats different?

Thanks Alan

POSTED BY: Alan Smith
Posted 11 years ago
In[1]:= r = RotationMatrix[theta]

Out[1]= {{Cos[theta], -Sin[theta]}, {Sin[theta], Cos[theta]}}

In[2]:= r.{x, y}

Out[2]= {x Cos[theta] - y Sin[theta], y Cos[theta] + x Sin[theta]}
POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard