# Mid-Point

Grammar — Mid-Point of sourcePoint and targetPoint
FlagsNative | Function

Returns the point half-way between the two given points.

# Arguments

  • point — Source Point
  • point — Target Point

Returns — point

native point MidPoint(point source, point dest);

Category: Point / Offsets

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/AILib.galaxy:2247

    lv_searchRadius = MinF(MaxF(libAIAI_gv_aIGateNearbyRange, (lv_offsetFromEdge + (0.5 * lv_originalDistance))), lv_maxSearchRadius);
    if ((lv_originalDistance < ((lv_searchRadius - lv_offsetFromEdge) * 2.0))) {
        lv_centerPoint = MidPoint(lp_selfPosition, lp_otherPoint);
    }
    else {

mods/novastoryassets.sc2modbase.sc2maps/maps/campaign/nova/nova01.sc2map/MapScript.galaxy:1409


    // Implementation
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "InvisibleEscortFlying", c_unitCreateIgnorePlacement, gv_pLAYER_02_DOMINION, MidPoint(PointFromId(2232), PointFromId(905)));
    lv_lookAtHelper = UnitLastCreated();
    UnitSetState(lv_lookAtHelper, c_unitStateInvulnerable, true);

mods/novastoryassets.sc2modbase.sc2maps/maps/campaign/nova/nova01.sc2map/MapScript.galaxy:1639

    }

    lv_midpoint = MidPoint(PointFromId(2232), PointFromId(905));
    lv_distance = DistanceBetweenPoints(lv_midpoint, PointFromId(905));
    lv_currentRadius = AngleBetweenPoints(lv_midpoint, UnitGetPosition(gv_warhawk));

mods/novastoryassets.sc2mod/base.sc2maps/maps/campaign/nova/nova01.sc2mapMapScript.galaxy:1409


    // Implementation
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "InvisibleEscortFlying", c_unitCreateIgnorePlacement, gv_pLAYER_02_DOMINION, MidPoint(PointFromId(2232), PointFromId(905)));
    lv_lookAtHelper = UnitLastCreated();
    UnitSetState(lv_lookAtHelper, c_unitStateInvulnerable, true);

mods/novastoryassets.sc2mod/base.sc2maps/maps/campaign/nova/nova01.sc2mapMapScript.galaxy:1639

    }

    lv_midpoint = MidPoint(PointFromId(2232), PointFromId(905));
    lv_distance = DistanceBetweenPoints(lv_midpoint, PointFromId(905));
    lv_currentRadius = AngleBetweenPoints(lv_midpoint, UnitGetPosition(gv_warhawk));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:6981

    }

    return MidPoint(PlayerStartLocation(PlayerGroupPlayer(libCOOC_gf_CommanderPlayers(), 1)), PlayerStartLocation(PlayerGroupPlayer(libCOOC_gf_CommanderPlayers(), 2)));
}