CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 19

Threaded View

  1. #13
    Join Date
    Oct 2008
    Posts
    1,456

    Re: a searching algorithm in a circle: 1 unidirectional, 2- Bididirectional

    Quote Originally Posted by dinodinoni View Post
    Would it be possible to give me the formula? or show me where to get it from?
    BTW, for big N,M, that's the avarage of the shortest path ( that is the euclidean distance ), that is, for a square region NxN :

    (1/N^2) * integral_from{-N/2}to{N/2} integral_from{-N/2}to{N/2} sqrt( x^2 + y^2) dxdy

    that is

    (N/8) integral_from{-1}to{1} integral_from{-1}to{1} sqrt( x^2 + y^2) dxdy

    that should equal N * ( sqrt(2) + arcsinh(1) )/6 = N * 0.382598...

    EDIT: sorry, I misread OReuben's post; as it's defined that distance does NOT approach the euclidean distance at all, so the calculation above as referred to the OReuben's reply is wrong ... ( the calcaulation in itself is correct though )
    Last edited by superbonzo; January 18th, 2015 at 04:27 AM. Reason: added corrigendum

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured