The distance between the two points required CAD (web version)

js code as follows:

  PointDis function () { 
 
    var = mxOcx.GetPoint Point1 (to false, 0,0, "\ n-point to take the first point:"); 
    IF (Point1 == null) 
    { 
        Alert ( "user cancels"); 
        return; 
    } 
    var point2 = mxOcx.GetPoint (true, point1.x, point1.y, "\ n point to take a second point:"); 
    IF (Point1 == null) 
    { 
        Alert ( "user cancels"); 
        return; 
    } 
    var = DDiS math.abs ((point1.x - point2.x) * (point1.x - point2.x) 
        + (point1.y - point2.y) * (point1.y - point2.y)); 
    Alert ( "two distance: "+ dDis.toString ()); 
 
}


Guess you like

Origin blog.51cto.com/10455293/2414263