is anybody ever done this?

I haven't tried the following logic:
var centerPt=null;
//description:get distance between ptB and centerPt //return: number
function getDistance(ptB)
{
if(centerPt==null||centerPt.mapPoint==null)
{
console.log("unexpected para,function getDistance()");
return "";
}
var ptA=centerPt.mapPoint;
return Math.sqrt(Math.pow(ptA.x-ptB.x,2)+Math.pow(ptA.y-ptB.y,2));
}
// get the center point
map.on("click", function(evt){
centerPt = evt.mapPoint;
})
//onDragStart, record the centerPt
map.on("mouse-drag-start",function(evt)
{
console.log("dragStart triggered");
centerPt=evt;
});
//onDrag, calculate distance between currentPoint and centerPt
map.on("mouse-drag",
function(evt){
var radius=getDistance(evt.mapPoint);
console.log("radius is:"+radius);
})