15,905,785 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.