I have a 2d array (lat*long) containing height information. I want to map this cylindrical projection to a actual sphere with radius r and plot it.
How would I do that? Sorry it so little info, but I’m completely lost right now …
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Longitude and latitude are not cylindrical coordinates; rather, they are equivalent to azimuth and elevation in spherical coordinates. At each latitude and longitude, you have a height (which may need to have the mean radius of the sphere added to it if it isn’t the true height from the center already).
Check out the sph2cart function, which converts from spherical to cartesian coordinates. You’ll have to convert from degrees to radians first.
Steps to take:
radians, not degrees
center of the sphere
sph2cartto get x,y,z matrices.Notes on sph2cart from the documentation: