var points = [{x:0,y:0},{x:1,y:1}];
points.dist = function()
    {
        var p1=this[0];
        var p2=this[1];
        var a = p2.x-p1.x;
        var b = p2.y-p1.y;
        return Math.sqrt(a*a+b*b);
    }; 
points.dist()

相关文章:

  • 2021-06-27
  • 2022-01-23
  • 2021-04-25
  • 2021-04-07
  • 2022-01-30
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2021-07-28
  • 2021-07-20
  • 2022-02-17
  • 2021-11-24
  • 2022-01-01
  • 2021-12-21
相关资源
相似解决方案