# Plotting coordinates onto globe

**URL:** <https://forum.kirupa.com/t/plotting-coordinates-onto-globe/16688>\
**Category:** Uncategorized\
**Created:** [March 27, 2003, 2:39pm UTC](https://forum.kirupa.com/t/plotting-coordinates-onto-globe/16688 "2003-03-27T14:39:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dazpearce](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@dazpearce](https://forum.kirupa.com/u/dazpearce)\
**Post date:** [March 27, 2003, 2:39pm UTC](https://forum.kirupa.com/t/plotting-coordinates-onto-globe/16688/1 "2003-03-27T14:39:37Z")

</div>

what will i have to do to the code below to see it working, also could someone comment the plotcircle function and emptycircle part to explain whats going on, thanks

code:--------------------------------------------------------------------------------  
GraphPole = newArray(latitude,longitude);  
GraphPole = [  
[61.67,-71.75],  
[61.67,-70.93],  
[61.69,-70.28] ,  
[61.69,-69.63]];

GraphEquat = newArray(latitude,longitude);  
GraphEquat = [  
[52.81,-71.57],  
[52.82,-70.83],  
[52.84,-70.0 8] ] ;

function degreesToRadians(a) {  
return a\*Math.PI/180.0;  
}

function polarToCartesian(radius,lat,long) {  
return {x:radius\* Math.cos(lat)_Math.cos(long),y:radius_Math.cos(latitude)\*Math.sin(longitude) };  
}

function plotCircle(radius,origin,a) {  
for (var i=0;i\<a.length;i++) {  
var polar = a[i];  
var cart =polarToCartesian(radius,degreesToRadians(polar[0]  
),degreesToRadians(polar[1]));  
cart.x += origin.x;  
cart.y += origin.y;  
if (i==0) {  
moveTo(cart.x,cart.y);  
saveFirst = cart;  
} else {  
lineTo(cart.x,cart.y);  
}  
}  
moveTo(saveFirst.x,saveFirst.y); // close the circle  
}

this.emptyMovieClip();  
plotCircle(200,{x:200,y:200},GraphPole);  
plotCircle(200,{x:200,y:200},GraphEquat);
