# Square Root (Real)

Grammar — Square root(x)
FlagsNative | Function

Returns the square root of a number.

# Arguments

  • fixed — Value

Returns — fixed

native fixed SquareRoot(fixed x);

Category: Math / Arithmetic

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L767
SquareRoot((lv_x*lv_x+lv_y*lv_y))
// L767
SquareRoot((lv_x*lv_x+lv_y*lv_y))
// L561
SquareRoot((Pow((gv_voidCrystals[lp_index].lv_minorRadius * Cos(lv_normalizedCurrentAngle)), 2.0) + Pow((gv_voidCrystals[lp_index].lv_majorRadius * Sin(lv_normalizedCurrentAngle)), 2.0)))
// L2116
SquareRoot((Pow(lv_sideC, 2.0) - Pow((lv_sideA * Cos(lv_angleB)), 2.0)))
// L561
SquareRoot((Pow((gv_voidCrystals[lp_index].lv_minorRadius * Cos(lv_normalizedCurrentAngle)), 2.0) + Pow((gv_voidCrystals[lp_index].lv_majorRadius * Sin(lv_normalizedCurrentAngle)), 2.0)))
// L2116
SquareRoot((Pow(lv_sideC, 2.0) - Pow((lv_sideA * Cos(lv_angleB)), 2.0)))

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L4837
SquareRoot((Pow((lv_cameraPosition[0]-lv_effectPosition[0]), 2.0) + Pow((lv_cameraPosition[1]-lv_effectPosition[1]), 2.0) + Pow((lv_cameraPosition[2]-lv_effectPosition[2]), 2.0)))

# mods/heroesdata.stormmod

AILib.galaxy

// L89
SquareRoot(diffx * diffx + diffy * diffy)

# mods/novastoryassets.sc2mod

MapScript.galaxy

// L4484
SquareRoot((Pow((lv_cameraPosition[0]-lv_effectPosition[0]), 2.0) + Pow((lv_cameraPosition[1]-lv_effectPosition[1]), 2.0) + Pow((lv_cameraPosition[2]-lv_effectPosition[2]), 2.0)))
// L4484
SquareRoot((Pow((lv_cameraPosition[0]-lv_effectPosition[0]), 2.0) + Pow((lv_cameraPosition[1]-lv_effectPosition[1]), 2.0) + Pow((lv_cameraPosition[2]-lv_effectPosition[2]), 2.0)))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L22537
SquareRoot(RandomFixed(0.0, 1.0))
// L22565
SquareRoot(RandomFixed(0.0, 1.0))
// L22593
SquareRoot(RandomFixed(0.0, 1.0))
// L22621
SquareRoot(RandomFixed(0.0, 1.0))
// L25254
SquareRoot((Pow((lv_cameraPosition[0]-lv_effectPosition[0]), 2.0) + Pow((lv_cameraPosition[1]-lv_effectPosition[1]), 2.0) + Pow((lv_cameraPosition[2]-lv_effectPosition[2]), 2.0)))
// L29175
SquareRoot((Pow((lv_cameraPosition[0]-lv_effectPosition[0]), 2.0) + Pow((lv_cameraPosition[1]-lv_effectPosition[1]), 2.0) + Pow((lv_cameraPosition[2]-lv_effectPosition[2]), 2.0)))