It means that divisions by zero are quite probable.
Geometry Create
not ratedCreates different geometrical shapes (line, triangle, quadrilater, circle, arc of circle) made out of dummy units, and returns the units in the form of a group.
//*********************************
//Geometry Create
//by Daelin
//
//CONTAINS THE FOLLOWING IMPORTANT FUNCTIONS
//1. CreateLine - Creates a line between two points, made out of units and returns the units in the
//form of a group. Frequency represents the number of units from which the line consists.
//2. CreateTriangle - Just as above but it create a triangle between three points. Frequency represents
//the number of units for each side of the triangle.
//3. CreateQuadrilater - Like CreateLine but creates a Quadrilater between four points. Frequency
//represents the number of units for each side of the quadrilater.
//4. CreateCircle - Creates a circle around a point, with a certain radius made out of units and returns
//the unit in the form of a group. Frequency represents the number of units for a quarter of the circle.
//5. CreateCircleSector - Creates only an Arc of Circle, between two angles, made out of units, and
//returns them in the form of a group. Frequency represents the total number of units from which the
//arc is made out of.
//*********************************
function PolarProjectionX takes real x, real distance, real angle returns real
return x+distance*Cos(angle * bj_DEGTORAD)
endfunction
function PolarProjectionY takes real y, real distance, real angle returns real
return y+distance*Sin(angle * bj_DEGTORAD)
endfunction
function GetAngleBetweenPoints takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG * Atan2(y2 - y1, x2 - x1)
endfunction
function GetDistanceBetweenPoints takes real x1, real y1,real x2, real y2 returns real
return SquareRoot((x2-x1)*(x2-x1) + (y2-y1) * (y2-y1))
endfunction
function CreateDummy takes player p, integer rawcode, real x, real y returns unit
local unit u = CreateUnit(p,rawcode,x,y,0.00)
call UnitAddAbility(u,'Aloc')
return u
endfunction
function CreateLine takes real x1, real y1, real x2, real y2, integer rawcode, integer frequency returns group
local group g
local real a
local real b
local real i
local real aux
local real steps=SquareRoot(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)))/(frequency+4)
if (x1==x2) then
return null
else
if (x1>x2) then
set aux=x1
set x1=x2
set x2=aux
set aux=y1
set y1=y2
set y2=aux
endif
set g = CreateGroup()
set a = (y1-y2)/(x1-x2)
set b = (y2*x1-y1*x2)/(x1-x2)
set i = x1
loop
exitwhen i>x2
call GroupAddUnit(g, CreateDummy(Player(15), rawcode, i, a*i+b))
set i = i+steps
endloop
endif
return g
endfunction
function CreateTriangle takes real x1, real y1, real x2, real y2, real x3, real y3, integer rawcode, integer frequency returns group
local group g = CreateGroup()
call GroupAddGroup(CreateLine(x1,y1,x2,y2,rawcode,frequency),g)
call GroupAddGroup(CreateLine(x1,y1,x3,y3, rawcode, frequency),g)
call GroupAddGroup(CreateLine(x2,y2,x3,y3, rawcode, frequency),g)
return g
endfunction
function CreateQuadrilater takes real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4, integer rawcode, integer frequency returns group
local group g = CreateGroup()
call GroupAddGroup(CreateLine(x1,y1,x2,y2,rawcode,frequency),g)
call GroupAddGroup(CreateLine(x2,y2,x3,y3,rawcode,frequency),g)
call GroupAddGroup(CreateLine(x3,y3,x4,y4,rawcode,frequency),g)
call GroupAddGroup(CreateLine(x4,y4,x1,y1,rawcode,frequency),g)
return g
endfunction
function CreateCircle takes real x, real y, real radius, integer rawcode, integer frequency returns group
local group g = CreateGroup()
local real steps = frequency*4
local real jump = 360/steps
local integer i = 1
loop
exitwhen i>frequency
call GroupAddUnit(g, CreateDummy(Player(15), rawcode, PolarProjectionX(x, radius, jump*i), PolarProjectionY(y, radius, jump*i)))
set i=i+1
endloop
return g
endfunction
function CreateCircleArc takes real x, real y, real radius, real angle1, real angle2, integer rawcode, integer frequency returns group
local group g = CreateGroup()
local real jump
local integer i = 0
if angle1>angle2 then
set jump = angle1
set angle1 = angle2
set angle2 = jump
endif
set jump = (angle2-angle1)/frequency
loop
exitwhen i==frequency
call GroupAddUnit(g, CreateDummy(Player(15), rawcode, PolarProjectionX(x, radius, angle1+jump*i), PolarProjectionY(y,radius,angle1+jump*i)))
set i = i+1
endloop
return g
endfunctiondivision by a difference is asking for troubleWhat do you mean by that?
set a = (y1-y2)/(x1-x2)
set b = (y2*x1-y1*x2)/(x1-x2)