# Mid-Point
Grammar — Mid-Point of sourcePoint and targetPoint
Flags —Native
|Function
Returns the point half-way between the two given points.
# Arguments
point
— Source Pointpoint
— Target Point
Returns — point
native point MidPoint(point source, point dest);
# Related
Category: Point / Offsets
- Point Facing Angle —
point
— libNtve_gf_PointFacingAngle - Point With Z Offset —
point
— libNtve_gf_PointWithZOffset - Point With Offset —
point
— PointWithOffset - Point With Polar Offset —
point
— PointWithOffsetPolar - Point Offset Towards Point —
point
— libNtve_gf_PointOffsetTowardsPoint - Random Point Between Points —
point
— libNtve_gf_RandomPointBetweenPoints - Reflected Point —
point
— PointReflect - Interpolated Point —
point
— PointInterpolate - Mid-Point —
point
— MidPoint
# Examples
mods/heroesdata.stormmod — base.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.sc2mod — base.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.sc2mod — base.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.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.sc2mod/base.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/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:6981
}
return MidPoint(PlayerStartLocation(PlayerGroupPlayer(libCOOC_gf_CommanderPlayers(), 1)), PlayerStartLocation(PlayerGroupPlayer(libCOOC_gf_CommanderPlayers(), 2)));
}