Click here to Skip to main content
15,905,785 members

Comments by paradesic (Top 4 by date)

paradesic 14-Dec-22 10:57am View    
By 'this location', I mean that the field line is intially at the sphere centre, but I shift it towards the sphere edge, and then rotate it to the angle theta, so it sits on the sphere surface at some position (this position could be anywhere).

So if you imagine any position on the surface of a sphere, and the axis that would be normal to that point of the sphere (i.e. pointing straight out of the sphere surface) - this is the axis I want to rotate around.

It should look like this before (blue) and after (orange) rotation:
https://imgur.com/a/VAV2DCe
paradesic 13-Dec-22 8:36am View    
It's not a rotation about the polar angle I need, but like this: https://imgur.com/a/oUSwcs8 (see white arrow around the green axis).
i.e. for whatever location I place the origin of the field line, the axis that is normal to the sphere surface at that location is the what I want to rotate around.
paradesic 13-Dec-22 6:13am View    
I've updated the post with the attempt of perform the rotation at the sphere centre, and then displacing it and rotating again to the desired location. I've added the rotation matrices as comments in the code. This method (rot around x-axis, the y-axis) is different to what I replied to you with before, but I still don't get the result I expect - i.e. the final field line doesnt show the expected rotation to the angle gamma.
paradesic 12-Dec-22 4:40am View    
I have tried doing the rotation at the sphere centre, but because there is no 'z' information, I think the field line structure is lost, and I end up with just a diagonal line.