The function 'acos' returns a var, not an ANGLE struct. Change the line 'ANGLE angle' to 'var angle'.