Showing results 1 to 4 of 4

Thread: InterSector Distance

  1. #1
    Senior Member Reputation: 498
    Join Date
    2008-08-14
    Posts
    3,070


    Default InterSector Distance

    Dears,

    do you know smart way to calculate Inter-Sector Distance
    instead of normal Inter-site distance as in some cases/ studies calculating by Sector Orientation is more accurate
    Attached Images Attached Images

  2. #2
    Moderator Reputation: 3629
    Join Date
    2008-01-20
    Location
    Earth
    Posts
    1,104


    1 out of 1 members found this post helpful.

    Default Re: InterSector Distance

    Do you want to calculate the inter sector distance based on the BW of the antenna in a sector?

    So something like this:
    mapinfo - Sectors pointing to a lat long - Geographic Information Systems Stack Exchange

    Then you can calculate distance to nearest point of the sector


    (related code)

    Function CreateAnnulusSector( ByVal oCenterPoint As Object
    , ByVal fInnerRadius As Float 'in meters
    , ByVal fOuterRadius As Float 'in meters
    , ByVal fStartAngle As Float
    , ByVal fEndAngle As Float
    , ByVal nResolution As Integer
    ) As Object

    Dim oSector, oCutter As Object
    Dim fAngle, fRotatedAngle, fX, fY, fDistance As Float
    Dim i As Integer

    CreateAnnulusSector = oCenterPoint

    '**Create concentric circle
    oSector = CartesianBuffer(oCenterPoint, nResolution, fOuterRadius, "m")
    oSector = Erase(oSector, CartesianBuffer(oCenterPoint, nResolution, fInnerRadius, "m"))

    '**Find center coordinates
    fX = CentroidX(oCenterPoint)
    fY = CentroidY(oCenterPoint)
    '**Calculate distance for cutter object
    fDistance = 3 * fOuterRadius

    '**Create cutter object
    Create Pline Into Variable oCutter
    1 (fX, fY)
    Alter Object oCutter
    Node Add (fX + fDistance, fY)

    fRotatedAngle = fEndAngle - fStartAngle
    If fRotatedAngle > 360 Then
    fRotatedAngle = fRotatedAngle - 360
    End If
    If fRotatedAngle < 0 Then
    fRotatedAngle = fRotatedAngle + 360
    End If

    For i = 4 To 1 Step -1
    If (i * 90) < fRotatedAngle Then
    Alter Object oCutter
    Node Add ( fX + ((Cos(fRotatedAngle * DEG_2_RAD)) * fDistance)
    , fY + ((Sin(fRotatedAngle * DEG_2_RAD)) * fDistance))
    Exit For
    Else
    Alter Object oCutter
    Node Add ( fX + ((Cos((i * 90) * DEG_2_RAD)) * fDistance)
    , fY + ((Sin((i * 90) * DEG_2_RAD)) * fDistance))
    End If
    Next

    '**Rotating cutter object to start angle
    oCutter = RotateAtPoint(oCutter, fStartAngle, oCenterPoint)
    '**Convert cutter polyline to a polygon
    oCutter = ConvertToRegion(oCutter)
    '**Erase the concentric circle with the cutter object
    oSector = Erase(oSector, oCutter)

    CreateAnnulusSector = oSector

    End Function

  3. #3
    Senior Member Reputation: 498
    Join Date
    2008-08-14
    Posts
    3,070


    Default Re: InterSector Distance

    Quote Originally Posted by DCA View Post
    Do you want to calculate the inter sector distance based on the BW of the antenna in a sector?

    So something like this:
    mapinfo - Sectors pointing to a lat long - Geographic Information Systems Stack Exchange

    Then you can calculate distance to nearest point of the sector


    (related code)

    Function CreateAnnulusSector( ByVal oCenterPoint As Object
    , ByVal fInnerRadius As Float 'in meters
    , ByVal fOuterRadius As Float 'in meters
    , ByVal fStartAngle As Float
    , ByVal fEndAngle As Float
    , ByVal nResolution As Integer
    ) As Object

    Dim oSector, oCutter As Object
    Dim fAngle, fRotatedAngle, fX, fY, fDistance As Float
    Dim i As Integer

    CreateAnnulusSector = oCenterPoint

    '**Create concentric circle
    oSector = CartesianBuffer(oCenterPoint, nResolution, fOuterRadius, "m")
    oSector = Erase(oSector, CartesianBuffer(oCenterPoint, nResolution, fInnerRadius, "m"))

    '**Find center coordinates
    fX = CentroidX(oCenterPoint)
    fY = CentroidY(oCenterPoint)
    '**Calculate distance for cutter object
    fDistance = 3 * fOuterRadius

    '**Create cutter object
    Create Pline Into Variable oCutter
    1 (fX, fY)
    Alter Object oCutter
    Node Add (fX + fDistance, fY)

    fRotatedAngle = fEndAngle - fStartAngle
    If fRotatedAngle > 360 Then
    fRotatedAngle = fRotatedAngle - 360
    End If
    If fRotatedAngle < 0 Then
    fRotatedAngle = fRotatedAngle + 360
    End If

    For i = 4 To 1 Step -1
    If (i * 90) < fRotatedAngle Then
    Alter Object oCutter
    Node Add ( fX + ((Cos(fRotatedAngle * DEG_2_RAD)) * fDistance)
    , fY + ((Sin(fRotatedAngle * DEG_2_RAD)) * fDistance))
    Exit For
    Else
    Alter Object oCutter
    Node Add ( fX + ((Cos((i * 90) * DEG_2_RAD)) * fDistance)
    , fY + ((Sin((i * 90) * DEG_2_RAD)) * fDistance))
    End If
    Next

    '**Rotating cutter object to start angle
    oCutter = RotateAtPoint(oCutter, fStartAngle, oCenterPoint)
    '**Convert cutter polyline to a polygon
    oCutter = ConvertToRegion(oCutter)
    '**Erase the concentric circle with the cutter object
    oSector = Erase(oSector, oCutter)

    CreateAnnulusSector = oSector

    End Function
    Excuse me, is this Excel VBA code or how to use it?

  4. #4
    Moderator Reputation: 3629
    Join Date
    2008-01-20
    Location
    Earth
    Posts
    1,104


    Default Re: InterSector Distance

    it is MapBasic (use it in Mapinfo)

Bookmarks

Bookmarks

Posting Rules

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