# Angle Between Points

Grammar — Angle from p1|Point to p2|Point
FlagsNative | Function

Returns the angle from point 1 to point 2 as a real value, in degrees.

# Arguments

  • point — Point 1
  • point — Point 2

Returns — fixed

native fixed AngleBetweenPoints(point p1, point p2);

Category: Point / Measurements

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L1798
AngleBetweenPoints(gv_terraTronPosition, lv_initialOffsetPoint)
// L3104
AngleBetweenPoints(lv_posCur, lv_posNext)
// L4935
AngleBetweenPoints(lv_posInterceptor, lv_posViking)
// L6325
AngleBetweenPoints(lv_posCurrent, UnitGetPosition(gv_viking))
// L6338
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L6429
AngleBetweenPoints(lv_posCurrent, lv_posFinish)
// L6439
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L6535
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L6548
AngleBetweenPoints(lv_posCurrent, lv_posFinish)
// L6558
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L3733
AngleBetweenPoints(UnitGetPosition(EventUnit()), UnitGetPosition(gv_activeCivilianShip))
// L4532
AngleBetweenPoints(PointFromId(644), PointFromId(4173))
// L4535
AngleBetweenPoints(PointFromId(645), PointFromId(565))
// L379
AngleBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L390
AngleBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L397
AngleBetweenPoints(lv_currentPoint, gv_trainPath[lv_currentTarget])
// L577
AngleBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L588
AngleBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L2155
AngleBetweenPoints(UnitGetPosition(auto499A4BF2_var), gv_trainPath[FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))])
// L5912
AngleBetweenPoints(UnitGetPosition(auto9586D451_var), UnitGetPosition(lv_crate))
// L5940
AngleBetweenPoints(UnitGetPosition(auto9C174672_var), UnitGetPosition(lv_crate))
// L2557
AngleBetweenPoints(UnitGetPosition(EventUnitDamageSourceUnit()), UnitGetPosition(lv_scientist))
// L2560
AngleBetweenPoints(UnitGetPosition(EventUnit()), UnitGetPosition(lv_scientist))
// L2616
AngleBetweenPoints(UnitGetPosition(lv_scientist), UnitGetPosition(UnitGroupUnit(lv_intruderGroup, 1)))
// L2672
AngleBetweenPoints(UnitGetPosition(lv_scientist), UnitGetPosition(UnitGroupUnit(lv_brutaliskGroup, 1)))
// L2728
AngleBetweenPoints(UnitGetPosition(lv_scientist), UnitGetPosition(UnitGroupUnit(lv_hybridGroup, 1)))
// L3713
AngleBetweenPoints(lp_sourceCenter, lv_sourceAfterScaled)
// L771
AngleBetweenPoints(PointFromId(1140), UnitGetPosition(autoA878FA45_var))
// L2357
AngleBetweenPoints(lv_a, lv_b)
// L596
AngleBetweenPoints(UnitGetPosition(lp_activatedunit), lv_rallypoint)
// L8319
AngleBetweenPoints(UnitGetPosition(auto8DBA43E6_var), lv_rallypoint)
// L10595
AngleBetweenPoints(UnitGetPosition(UnitLastCreated()), PointFromId(2223))
// L5617
AngleBetweenPoints(UnitGetPosition(gv_artifact), UnitGetPosition(autoE89A9445_var))
// L2778
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto45ED8A27_var))
// L2786
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto11B330CC_var))
// L3617
AngleBetweenPoints(PointWithOffset(PointFromId(548), 0.0, -1.5), UnitGetPosition(auto4DA823A6_var))
// L3625
AngleBetweenPoints(PointWithOffset(PointFromId(548), 0.0, -1.5), UnitGetPosition(autoE853CE9F_var))
// L6358
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto3847C7E3_var))
// L6366
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto190E44E5_var))
// L6376
AngleBetweenPoints(PointWithOffset(PointFromId(664), 0.0, -1.5), UnitGetPosition(autoE8B100A8_var))
// L6384
AngleBetweenPoints(PointWithOffset(PointFromId(664), 0.0, -1.5), UnitGetPosition(autoCE0E774C_var))
// L7522
AngleBetweenPoints(UnitGetPosition(gv_tHEONEZERATUL), UnitGetPosition(lv_unit))
// L9088
AngleBetweenPoints(PointFromId(189), PointFromId(1712))
// L1798
AngleBetweenPoints(gv_terraTronPosition, lv_initialOffsetPoint)
// L3104
AngleBetweenPoints(lv_posCur, lv_posNext)
// L4935
AngleBetweenPoints(lv_posInterceptor, lv_posViking)
// L6325
AngleBetweenPoints(lv_posCurrent, UnitGetPosition(gv_viking))
// L6338
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L6429
AngleBetweenPoints(lv_posCurrent, lv_posFinish)
// L6439
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L6535
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L6548
AngleBetweenPoints(lv_posCurrent, lv_posFinish)
// L6558
AngleBetweenPoints(UnitGetPosition(lv_plane), UnitGetPosition(gv_viking))
// L3733
AngleBetweenPoints(UnitGetPosition(EventUnit()), UnitGetPosition(gv_activeCivilianShip))
// L4532
AngleBetweenPoints(PointFromId(644), PointFromId(4173))
// L4535
AngleBetweenPoints(PointFromId(645), PointFromId(565))
// L379
AngleBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L390
AngleBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L397
AngleBetweenPoints(lv_currentPoint, gv_trainPath[lv_currentTarget])
// L577
AngleBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L588
AngleBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L2155
AngleBetweenPoints(UnitGetPosition(auto499A4BF2_var), gv_trainPath[FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))])
// L5912
AngleBetweenPoints(UnitGetPosition(auto9586D451_var), UnitGetPosition(lv_crate))
// L5940
AngleBetweenPoints(UnitGetPosition(auto9C174672_var), UnitGetPosition(lv_crate))
// L2557
AngleBetweenPoints(UnitGetPosition(EventUnitDamageSourceUnit()), UnitGetPosition(lv_scientist))
// L2560
AngleBetweenPoints(UnitGetPosition(EventUnit()), UnitGetPosition(lv_scientist))
// L2616
AngleBetweenPoints(UnitGetPosition(lv_scientist), UnitGetPosition(UnitGroupUnit(lv_intruderGroup, 1)))
// L2672
AngleBetweenPoints(UnitGetPosition(lv_scientist), UnitGetPosition(UnitGroupUnit(lv_brutaliskGroup, 1)))
// L2728
AngleBetweenPoints(UnitGetPosition(lv_scientist), UnitGetPosition(UnitGroupUnit(lv_hybridGroup, 1)))
// L3713
AngleBetweenPoints(lp_sourceCenter, lv_sourceAfterScaled)
// L771
AngleBetweenPoints(PointFromId(1140), UnitGetPosition(autoA878FA45_var))
// L2357
AngleBetweenPoints(lv_a, lv_b)
// L596
AngleBetweenPoints(UnitGetPosition(lp_activatedunit), lv_rallypoint)
// L8319
AngleBetweenPoints(UnitGetPosition(auto8DBA43E6_var), lv_rallypoint)
// L10595
AngleBetweenPoints(UnitGetPosition(UnitLastCreated()), PointFromId(2223))
// L5617
AngleBetweenPoints(UnitGetPosition(gv_artifact), UnitGetPosition(autoE89A9445_var))
// L2778
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto45ED8A27_var))
// L2786
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto11B330CC_var))
// L3617
AngleBetweenPoints(PointWithOffset(PointFromId(548), 0.0, -1.5), UnitGetPosition(auto4DA823A6_var))
// L3625
AngleBetweenPoints(PointWithOffset(PointFromId(548), 0.0, -1.5), UnitGetPosition(autoE853CE9F_var))
// L6358
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto3847C7E3_var))
// L6366
AngleBetweenPoints(PointWithOffset(UnitGetPosition(gv_tHEONEZERATUL), 0.0, -1.5), UnitGetPosition(auto190E44E5_var))
// L6376
AngleBetweenPoints(PointWithOffset(PointFromId(664), 0.0, -1.5), UnitGetPosition(autoE8B100A8_var))
// L6384
AngleBetweenPoints(PointWithOffset(PointFromId(664), 0.0, -1.5), UnitGetPosition(autoCE0E774C_var))
// L7522
AngleBetweenPoints(UnitGetPosition(gv_tHEONEZERATUL), UnitGetPosition(lv_unit))
// L9088
AngleBetweenPoints(PointFromId(189), PointFromId(1712))
// L674
AngleBetweenPoints(RegionGetCenter(lp_region), UnitGetPosition(UnitLastCreated()))
// L688
AngleBetweenPoints(RegionGetCenter(lp_region), UnitGetPosition(UnitLastCreated()))
// L512
AngleBetweenPoints(UnitGroupCenterOfGroup(lv_enemies), UnitGetPosition(lp_diamondback))
// L514
AngleBetweenPoints(UnitGroupCenterOfGroup(lv_enemies), UnitGetPosition(lp_diamondback))
// L515
AngleBetweenPoints(UnitGroupCenterOfGroup(lv_enemies), UnitGetPosition(lp_diamondback))
// L974
AngleBetweenPoints(libNtve_gf_CenterOfUnitGroup(lp_unitgroup), lp_endpoint)
// L9352
AngleBetweenPoints(RegionGetCenter(RegionFromId(56)), PointFromId(446))
// L1326
AngleBetweenPoints(gv_hybridCellLocation[auto0CF21101_var], gv_hybridReleaseLocation[auto0CF21101_var])
// L533
AngleBetweenPoints(UnitGetPosition(lv_hybrid), UnitGetPosition(auto0A92F2EA_var))
// L1586
AngleBetweenPoints(UnitGetPosition(gv_kerrigan), UnitGetPosition(gv_kerrigan22))
// L1614
AngleBetweenPoints(UnitGetPosition(gv_kerrigan2), UnitGetPosition(gv_kerrigan22))
// L1642
AngleBetweenPoints(UnitGetPosition(gv_kerrigan22), UnitGetPosition(gv_kerrigan))
// L1643
AngleBetweenPoints(UnitGetPosition(gv_kerrigan22), UnitGetPosition(gv_kerrigan2))
// L1834
AngleBetweenPoints(UnitGetPosition(gv_kerrigan), UnitGetPosition(gv_kerrigan22))