Rotate Nodes Around x & z-Axis: Second Opinion Needed

In summary, the program involves rotating four nodes (x,y,z) around the z-axis and then the x-axis using rotation equations and an angle. The purpose is to change the input data into a new coordinate system. While the data may appear correct, a second opinion is needed.
  • #1
laminatedevildoll
211
0
I had to rotate four nodes x,y,z around the z-axis, then the x-axis using rotation equations and an angle. The whole point of the program is to change the input data into a new coordinate system. I think that my data looks right, but I need a second opinion.

Input

x | y | z

1.| 0.00 | 0.00 | -2.00
2.| -10.00 | 0.00 | -2.00
3.| 0.00 | 5.00 | -2.00
4.| -10.00 | 5.00 | -2.00

Output

-10.0000 -0.742781 -1.85695
0.00000 -0.742781 -1.85695
-10.000 4.64238 -1.85695
0.00000 4.64238 -1.85695
 
Last edited:
Mathematics news on Phys.org
  • #2
I am not an expert on this, but as I try to visualize:

On the room floor, the X axis runs W-E, Y axis runs S-N. Z axis runs floor-ceiling.

Your 1st node is located on the Z axis 2 inches below the origin. You first rotate it around the Z axis, and it stays where it is. You then rotate it around the X axis, shouldn't its new coordinates be (0,0,+2)?
 
  • #3



After reviewing your input and output data, it appears that your rotations around the z-axis were successful in changing the z-coordinates of the nodes. However, it seems that there may be some issues with the rotations around the x-axis. The y-coordinates for all nodes should remain unchanged when rotating around the x-axis, but in your output, they have all changed to the same value of -0.742781. This could indicate an error in your rotation equations or angle used. I would suggest double-checking your calculations and possibly seeking a second opinion or assistance from a colleague or mentor. Overall, your approach and understanding of rotating nodes around the x and z-axis seem to be correct, but it's always good to have another set of eyes to ensure accuracy.
 

1. How do I rotate nodes around the x-axis?

To rotate nodes around the x-axis, you will need to use the rotateX() function in your code. This function takes in an angle in degrees as its parameter and rotates the nodes around the x-axis by that angle.

2. Can I rotate nodes around both the x and z-axis?

Yes, you can rotate nodes around both the x and z-axis by using the rotateX() and rotateZ() functions in your code. You can also combine these functions to rotate nodes around both axes simultaneously.

3. How do I specify the center point of rotation?

The center point of rotation can be specified by using the translate() function in your code. This function allows you to move the origin of the coordinate system to a specific point, which will then serve as the center point of rotation for the rotateX() and rotateZ() functions.

4. Can I rotate nodes in 3D space?

Yes, you can rotate nodes in 3D space by using the rotateX() and rotateZ() functions along with the translate() function to specify the center point of rotation. This allows you to rotate nodes around both the x and z-axis in 3D space.

5. How do I reset the rotation of nodes?

To reset the rotation of nodes, you can use the resetMatrix() function in your code. This function resets the current transformation matrix, which includes any rotations applied to nodes. It is important to note that this function will also reset any other transformations applied to nodes, such as translations or scaling.

Similar threads

Replies
2
Views
1K
Replies
3
Views
816
Replies
2
Views
642
  • Linear and Abstract Algebra
Replies
1
Views
715
  • Linear and Abstract Algebra
Replies
1
Views
951
Replies
4
Views
724
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
4
Views
2K
  • Linear and Abstract Algebra
Replies
6
Views
2K
Back
Top