Troubleshooting MathCAD: Rotation of Body Vector About an Axis

AI Thread Summary
The discussion revolves around defining a function in MathCAD for rotating a body vector about an axis by a specified angle. The user initially encounters an error related to invalid array indexing, which suggests that MathCAD misinterprets the function's parentheses as array indices. The issue is resolved when the user realizes that MathCAD uses zero-based indexing, meaning the first index of the vector should be 0 instead of 1. This correction eliminates the error, allowing the function to evaluate correctly.
TheJCBand
Messages
10
Reaction score
0
I'm not sure if this is the right place for this question, but I didn't see a forum specifically about software.

I'm trying to define a function in MathCAD that describes the rotation of a body vector about an axis u by an angle ɸ. What I've typed in is:

R(ɸ,u):= [ 3x3 matrix where each element is a function of ɸ and u ]

When I try evaluating the function for a given ɸ and u, it gives me the error "This array index is invalid for this array."
It sounds like the program thinks the parentheses indicate a an array index instead of the arguments of the function. Does anyone have any suggestions?

Thanks.
 
Physics news on Phys.org
I figured out the problem. My function R used indexes of the vector u, and the first index is 0 in MathCAD, and I using 1, so there was a u3 in the function, which didn't exist.
 
Back
Top