Translate and rotate data on a sphere

2 ビュー (過去 30 日間)
Zaheer Ali
Zaheer Ali 2022 年 7 月 16 日
回答済み: Prathamesh 2025 年 6 月 6 日
I am working on a problem to rotate a 3D dataset of a plane and place it on the surface of a sphere at a certain elevation and azimuth angle. Here is a pseudo code in MATLAB - any suggestions?
data = rand(100,3);
sphereRadius = 10; azimuth = -70; elevation = 25;
rotm = eul2rotm([azimuth 90-elevation 0]*pi/180)
dataNew = (data-mean(data) + [0 0 sphereRadius])*rotm

回答 (1 件)

Prathamesh
Prathamesh 2025 年 6 月 6 日
I understand that you want to rotate a 3D dataset and place it on a sphere at a certain elevation and angle.
You can try these steps:
  • Shift your 3D data so that its centroid is at the origin.
  • Use “rotm” to rotate this centered data.
  • Calculate the specific 3D Cartesian coordinates on the surface of the sphere that correspond to your given “sphereRadius”, “azimuth”, and “elevation”.
  • Shift the entire rotated dataset by adding these calculated target coordinates to every point.
This moves the plane from the origin to its final desired location on the sphere's surface.

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by