Posted By

boblinl on 07/22/10


Tagged

map


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

PixelJuice
scottwatkins


Conversion from spherical to cartesian coordinates


 / Published in: ActionScript 3
 

  1. /**
  2.  *Spherical [r, q, j] Cartesian [x, y, z]
  3.  *x = rsin qcos j
  4.  *y = rsin qsin j
  5.  *z = rcos q
  6.  */
  7. var x:Number = RADIUS * Math.sin( latitude ) * Math.cos( longitude );
  8. var y:Number = RADIUS * Math.sin( latitude ) * Math.sin( longitude );
  9. var z:Number = RADIUS * Math.cos( latitude );

Report this snippet  

You need to login to post a comment.