Re: [mapguide-users] Calculating a Euclidean Distance in Javascript

2008-05-22 Thread nclayton
Things look good. Thank you all for your input. So the final formula is: Math + Mapping > me But I am now able to reliably place measure segment length out while it is being drawn (I am using the wz_jsgraphics library to draw a "rubber-band" between the click start point and the mouse cursor).

Re: [mapguide-users] Calculating a Euclidean Distance in Javascript

2008-05-22 Thread nclayton
I think you just solved the problem...I am using US Survey Feet as my coordinate system. So if this is truely the case and not a coincidence, then I don't have to recalculate to feet because it's already there. I'll try that and see what I get. Thanks for the input! andrew.demerchant wrote: >

Re: [mapguide-users] Calculating a Euclidean Distance in Javascript

2008-05-22 Thread Andrew DeMerchant
It's either a pretty interesting coincidence that 23.529 / 77.196 = 0.3048, or else it's a units problem you've got (feet vs meters). 1 foot = 0.3048m. Andrew nclayton wrote: Hmmm...something's not lining up right. Here are my test values: Start Point x1 = 782968.222103 y1 = 1774880

RE: [mapguide-users] Calculating a Euclidean Distance in Javascript

2008-05-22 Thread nclayton
Hmmm...something's not lining up right. Here are my test values: Start Point x1 = 782968.222103 y1 = 1774880.116909 End Point x2 = 783044.338 y2 = 1774867.244367 I used this formula in php: $distance = sqrt(pow($x1 - $x2,2.0) + pow($y1 = $y2,2.0)) This gave me a value of 77.19671051057 $srs

RE: [mapguide-users] Calculating a Euclidean Distance in Javascript

2008-05-21 Thread Traian Stanev
Subject: RE: [mapguide-users] Calculating a Euclidean Distance in > Javascript > > This is the exact code that is being executed by the > MeasureEuclideanDistance API: > > double CCoordinateSystem::MeasureEuclideanDistance(double x1, double > y1, double x2, double y2) > { >

RE: [mapguide-users] Calculating a Euclidean Distance in Javascript

2008-05-21 Thread Bruce Dechant
This is the exact code that is being executed by the MeasureEuclideanDistance API: double CCoordinateSystem::MeasureEuclideanDistance(double x1, double y1, double x2, double y2) { double distance = 0.0; MG_TRY() distance = ::sqrt(::pow(x1 - x2, 2.0) + ::pow(y1 - y2, 2.0)); MG_CA