def findSoldierOffset(soldiers, i):
soldier = soldiers[i]
angle = i * 360 / len(soldiers)
return radialToCartesian(5, angle)
# This function does the math to determine the offset a soldier should stand at.
def radialToCartesian(radius, degrees):
radians = Math.PI / 180 * degrees
xOffset = radius * Math.cos(radians)
yOffset = radius * Math.sin(radians)
return {"x": xOffset, "y": yOffset}
In the code above I am having trouble. On the second function, it ends with a return statement but I am confused about were the {βxβ: xOffset, βyβ: yOffset} goes. Because I need that return value in a var the level an I donβt know where the return value goes.
Level is Ringer Bearer btw.