Skip to content

Instantly share code, notes, and snippets.

@sandyUni
Created September 13, 2016 13:16
Show Gist options
  • Save sandyUni/108ce2347c4446595c0927bb00b097e6 to your computer and use it in GitHub Desktop.
Save sandyUni/108ce2347c4446595c0927bb00b097e6 to your computer and use it in GitHub Desktop.
convert polar coordinate to Cartesian
function [X,Y,Z] = polarToCartesian(R,logi,lanti)
% convert polar coordinate to Cartesian
% R, logi(-pi~pi), lanti (-1/2*pi~1/2*pi) are Radius,longitude, lantitude
Z = R* sin(lanti);
Y = R* cos(lanti) *sin(logi);
X = R*cos(lanti) *cos(logi);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment