function getDirectionNameRelativeChar(charHandle, vector3)
local charVector3 = { getCharCoordinates(charHandle) }
local charHeading = getCharHeading(charHandle)
local vectorHeading = getHeadingFromVector2d(charVector3[1] - vector3[1], charVector3[2] - vector3[2])
local delta = charHeading - vectorHeading
if delta < 0 then
delta = 360 + delta
end
local sectors = {
{ "Front", 135, 225 },
{ "Back", 0, 45 },
{ "Back", 315, 360 },
{ "Left", 45, 135 },
{ "Right", 225, 315 }
}
for index, value in ipairs(sectors) do
if delta >= value[2] and delta <= value[3] then
return value[1], delta
end
end
end