{ "type": "Program", "statements": [ { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 24 } } }, "superClass": null, "implements": [], "body": [ { "type": "ClassProperty", "key": { "type": "Identifier", "name": "AG_CONST", "decorators": [], "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 29 } } }, "value": { "type": "NumberLiteral", "value": 0.607253, "loc": { "start": { "line": 17, "column": 41 }, "end": { "line": 17, "column": 53 } } }, "accessibility": "public", "static": true, "readonly": true, "declare": false, "optional": false, "computed": false, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, "column": 32 }, "end": { "line": 17, "column": 38 } } }, "definite": false, "decorators": [], "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 53 } } }, { "type": "ClassProperty", "key": { "type": "Identifier", "name": "TARGET_ANGLE", "decorators": [], "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 33 } } }, "value": { "type": "NumberLiteral", "value": 28.027, "loc": { "start": { "line": 18, "column": 45 }, "end": { "line": 18, "column": 51 } } }, "accessibility": "public", "static": true, "readonly": true, "declare": false, "optional": false, "computed": false, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 36 }, "end": { "line": 18, "column": 42 } } }, "definite": false, "decorators": [], "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 51 } } }, { "type": "ClassProperty", "key": { "type": "Identifier", "name": "expected", "decorators": [], "loc": { "start": { "line": 19, "column": 21 }, "end": { "line": 19, "column": 29 } } }, "value": { "type": "NumberLiteral", "value": 10362.6, "loc": { "start": { "line": 19, "column": 41 }, "end": { "line": 19, "column": 59 } } }, "accessibility": "public", "static": true, "readonly": true, "declare": false, "optional": false, "computed": false, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, "column": 32 }, "end": { "line": 19, "column": 38 } } }, "definite": false, "decorators": [], "loc": { "start": { "line": 19, "column": 21 }, "end": { "line": 19, "column": 59 } } }, { "type": "ClassProperty", "key": { "type": "Identifier", "name": "ANGLES", "decorators": [], "loc": { "start": { "line": 20, "column": 21 }, "end": { "line": 20, "column": 27 } } }, "value": { "type": "ArrayExpression", "elements": [ { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 42 }, "end": { "line": 20, "column": 52 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 53 }, "end": { "line": 20, "column": 60 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 42 }, "end": { "line": 20, "column": 60 } } }, "arguments": [ { "type": "NumberLiteral", "value": 45, "loc": { "start": { "line": 20, "column": 61 }, "end": { "line": 20, "column": 65 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 42 }, "end": { "line": 20, "column": 66 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 68 }, "end": { "line": 20, "column": 78 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 79 }, "end": { "line": 20, "column": 86 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 68 }, "end": { "line": 20, "column": 86 } } }, "arguments": [ { "type": "NumberLiteral", "value": 26.565, "loc": { "start": { "line": 20, "column": 87 }, "end": { "line": 20, "column": 93 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 68 }, "end": { "line": 20, "column": 94 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 96 }, "end": { "line": 20, "column": 106 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 107 }, "end": { "line": 20, "column": 114 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 96 }, "end": { "line": 20, "column": 114 } } }, "arguments": [ { "type": "NumberLiteral", "value": 14.0362, "loc": { "start": { "line": 20, "column": 115 }, "end": { "line": 20, "column": 122 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 96 }, "end": { "line": 20, "column": 123 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 125 }, "end": { "line": 20, "column": 135 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 136 }, "end": { "line": 20, "column": 143 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 125 }, "end": { "line": 20, "column": 143 } } }, "arguments": [ { "type": "NumberLiteral", "value": 7.12502, "loc": { "start": { "line": 20, "column": 144 }, "end": { "line": 20, "column": 151 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 125 }, "end": { "line": 20, "column": 152 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 154 }, "end": { "line": 20, "column": 164 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 165 }, "end": { "line": 20, "column": 172 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 154 }, "end": { "line": 20, "column": 172 } } }, "arguments": [ { "type": "NumberLiteral", "value": 3.57633, "loc": { "start": { "line": 20, "column": 173 }, "end": { "line": 20, "column": 180 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 154 }, "end": { "line": 20, "column": 181 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 183 }, "end": { "line": 20, "column": 193 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 194 }, "end": { "line": 20, "column": 201 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 183 }, "end": { "line": 20, "column": 201 } } }, "arguments": [ { "type": "NumberLiteral", "value": 1.78991, "loc": { "start": { "line": 20, "column": 202 }, "end": { "line": 20, "column": 209 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 183 }, "end": { "line": 20, "column": 210 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 212 }, "end": { "line": 20, "column": 222 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 223 }, "end": { "line": 20, "column": 230 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 212 }, "end": { "line": 20, "column": 230 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0.895174, "loc": { "start": { "line": 20, "column": 231 }, "end": { "line": 20, "column": 239 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 212 }, "end": { "line": 20, "column": 240 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 242 }, "end": { "line": 20, "column": 252 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 253 }, "end": { "line": 20, "column": 260 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 242 }, "end": { "line": 20, "column": 260 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0.447614, "loc": { "start": { "line": 20, "column": 261 }, "end": { "line": 20, "column": 269 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 242 }, "end": { "line": 20, "column": 270 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 272 }, "end": { "line": 20, "column": 282 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 283 }, "end": { "line": 20, "column": 290 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 272 }, "end": { "line": 20, "column": 290 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0.223811, "loc": { "start": { "line": 20, "column": 291 }, "end": { "line": 20, "column": 299 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 272 }, "end": { "line": 20, "column": 300 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 302 }, "end": { "line": 20, "column": 312 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 313 }, "end": { "line": 20, "column": 320 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 302 }, "end": { "line": 20, "column": 320 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0.111906, "loc": { "start": { "line": 20, "column": 321 }, "end": { "line": 20, "column": 329 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 302 }, "end": { "line": 20, "column": 330 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 332 }, "end": { "line": 20, "column": 342 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 343 }, "end": { "line": 20, "column": 350 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 332 }, "end": { "line": 20, "column": 350 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0.055953, "loc": { "start": { "line": 20, "column": 351 }, "end": { "line": 20, "column": 359 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 332 }, "end": { "line": 20, "column": 360 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 20, "column": 362 }, "end": { "line": 20, "column": 372 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 20, "column": 373 }, "end": { "line": 20, "column": 380 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 20, "column": 362 }, "end": { "line": 20, "column": 380 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0.027977, "loc": { "start": { "line": 20, "column": 381 }, "end": { "line": 20, "column": 389 } } } ], "optional": false, "loc": { "start": { "line": 20, "column": 362 }, "end": { "line": 20, "column": 390 } } } ], "loc": { "start": { "line": 20, "column": 41 }, "end": { "line": 20, "column": 391 } } }, "accessibility": "public", "static": true, "readonly": true, "declare": false, "optional": false, "computed": false, "typeAnnotation": { "type": "TSArrayType", "elementType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, "column": 30 }, "end": { "line": 20, "column": 36 } } }, "loc": { "start": { "line": 20, "column": 39 }, "end": { "line": 20, "column": 40 } } }, "definite": false, "decorators": [], "loc": { "start": { "line": 20, "column": 21 }, "end": { "line": 20, "column": 391 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 19 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 19 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "x", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, "column": 24 }, "end": { "line": 22, "column": 30 } } }, "decorators": [], "loc": { "start": { "line": 22, "column": 20 }, "end": { "line": 22, "column": 30 } } }, "loc": { "start": { "line": 22, "column": 20 }, "end": { "line": 22, "column": 30 } } } ], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, "column": 33 }, "end": { "line": 22, "column": 39 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "*", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 23, "column": 16 }, "end": { "line": 23, "column": 17 } } }, "right": { "type": "NumberLiteral", "value": 65536, "loc": { "start": { "line": 23, "column": 20 }, "end": { "line": 23, "column": 27 } } }, "loc": { "start": { "line": 23, "column": 16 }, "end": { "line": 23, "column": 27 } } }, "loc": { "start": { "line": 23, "column": 9 }, "end": { "line": 23, "column": 28 } } } ], "loc": { "start": { "line": 22, "column": 40 }, "end": { "line": 24, "column": 6 } } }, "loc": { "start": { "line": 22, "column": 19 }, "end": { "line": 24, "column": 6 } } }, "loc": { "start": { "line": 22, "column": 19 }, "end": { "line": 24, "column": 6 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 22, "column": 5 }, "end": { "line": 24, "column": 6 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "fnFloat", "decorators": [], "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 19 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "fnFloat", "decorators": [], "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 19 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "x", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, "column": 24 }, "end": { "line": 26, "column": 30 } } }, "decorators": [], "loc": { "start": { "line": 26, "column": 20 }, "end": { "line": 26, "column": 30 } } }, "loc": { "start": { "line": 26, "column": 20 }, "end": { "line": 26, "column": 30 } } } ], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, "column": 33 }, "end": { "line": 26, "column": 39 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "/", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 27, "column": 16 }, "end": { "line": 27, "column": 17 } } }, "right": { "type": "NumberLiteral", "value": 65536, "loc": { "start": { "line": 27, "column": 20 }, "end": { "line": 27, "column": 27 } } }, "loc": { "start": { "line": 27, "column": 16 }, "end": { "line": 27, "column": 27 } } }, "loc": { "start": { "line": 27, "column": 9 }, "end": { "line": 27, "column": 28 } } } ], "loc": { "start": { "line": 26, "column": 40 }, "end": { "line": 28, "column": 6 } } }, "loc": { "start": { "line": 26, "column": 19 }, "end": { "line": 28, "column": 6 } } }, "loc": { "start": { "line": 26, "column": 19 }, "end": { "line": 28, "column": 6 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 26, "column": 5 }, "end": { "line": 28, "column": 6 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "fnDegToRad", "decorators": [], "loc": { "start": { "line": 30, "column": 12 }, "end": { "line": 30, "column": 22 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "fnDegToRad", "decorators": [], "loc": { "start": { "line": 30, "column": 12 }, "end": { "line": 30, "column": 22 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "x", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, "column": 27 }, "end": { "line": 30, "column": 33 } } }, "decorators": [], "loc": { "start": { "line": 30, "column": 23 }, "end": { "line": 30, "column": 33 } } }, "loc": { "start": { "line": 30, "column": 23 }, "end": { "line": 30, "column": 33 } } } ], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, "column": 36 }, "end": { "line": 30, "column": 42 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "*", "left": { "type": "NumberLiteral", "value": 0.017453, "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 24 } } }, "right": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 31, "column": 27 }, "end": { "line": 31, "column": 28 } } }, "loc": { "start": { "line": 31, "column": 16 }, "end": { "line": 31, "column": 28 } } }, "loc": { "start": { "line": 31, "column": 9 }, "end": { "line": 31, "column": 29 } } } ], "loc": { "start": { "line": 30, "column": 43 }, "end": { "line": 32, "column": 6 } } }, "loc": { "start": { "line": 30, "column": 22 }, "end": { "line": 32, "column": 6 } } }, "loc": { "start": { "line": 30, "column": 22 }, "end": { "line": 32, "column": 6 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 30, "column": 5 }, "end": { "line": 32, "column": 6 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "cordicsincos", "decorators": [], "loc": { "start": { "line": 34, "column": 12 }, "end": { "line": 34, "column": 24 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "cordicsincos", "decorators": [], "loc": { "start": { "line": 34, "column": 12 }, "end": { "line": 34, "column": 24 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "target", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, "column": 34 }, "end": { "line": 34, "column": 40 } } }, "decorators": [], "loc": { "start": { "line": 34, "column": 25 }, "end": { "line": 34, "column": 40 } } }, "loc": { "start": { "line": 34, "column": 25 }, "end": { "line": 34, "column": 40 } } } ], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, "column": 43 }, "end": { "line": 34, "column": 49 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "x", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, "column": 17 }, "end": { "line": 35, "column": 23 } } }, "decorators": [], "loc": { "start": { "line": 35, "column": 13 }, "end": { "line": 35, "column": 14 } } }, "init": null, "loc": { "start": { "line": 35, "column": 13 }, "end": { "line": 35, "column": 14 } } } ], "kind": "let", "loc": { "start": { "line": 35, "column": 9 }, "end": { "line": 35, "column": 24 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "y", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 36, "column": 17 }, "end": { "line": 36, "column": 23 } } }, "decorators": [], "loc": { "start": { "line": 36, "column": 13 }, "end": { "line": 36, "column": 14 } } }, "init": null, "loc": { "start": { "line": 36, "column": 13 }, "end": { "line": 36, "column": 14 } } } ], "kind": "let", "loc": { "start": { "line": 36, "column": 9 }, "end": { "line": 36, "column": 24 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "targetAngle", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 37, "column": 27 }, "end": { "line": 37, "column": 33 } } }, "decorators": [], "loc": { "start": { "line": 37, "column": 13 }, "end": { "line": 37, "column": 24 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 37, "column": 36 }, "end": { "line": 37, "column": 46 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 37, "column": 47 }, "end": { "line": 37, "column": 54 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 37, "column": 36 }, "end": { "line": 37, "column": 54 } } }, "arguments": [ { "type": "Identifier", "name": "target", "decorators": [], "loc": { "start": { "line": 37, "column": 55 }, "end": { "line": 37, "column": 61 } } } ], "optional": false, "loc": { "start": { "line": 37, "column": 36 }, "end": { "line": 37, "column": 62 } } }, "loc": { "start": { "line": 37, "column": 13 }, "end": { "line": 37, "column": 62 } } } ], "kind": "let", "loc": { "start": { "line": 37, "column": 9 }, "end": { "line": 37, "column": 63 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "currAngle", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 38, "column": 25 }, "end": { "line": 38, "column": 31 } } }, "decorators": [], "loc": { "start": { "line": 38, "column": 13 }, "end": { "line": 38, "column": 22 } } }, "init": { "type": "NumberLiteral", "value": 0, "loc": { "start": { "line": 38, "column": 34 }, "end": { "line": 38, "column": 35 } } }, "loc": { "start": { "line": 38, "column": 13 }, "end": { "line": 38, "column": 35 } } } ], "kind": "let", "loc": { "start": { "line": 38, "column": 9 }, "end": { "line": 38, "column": 36 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "step", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, "column": 20 }, "end": { "line": 39, "column": 23 } } }, "decorators": [], "loc": { "start": { "line": 39, "column": 13 }, "end": { "line": 39, "column": 17 } } }, "init": null, "loc": { "start": { "line": 39, "column": 13 }, "end": { "line": 39, "column": 17 } } } ], "kind": "let", "loc": { "start": { "line": 39, "column": 9 }, "end": { "line": 39, "column": 25 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 40, "column": 9 }, "end": { "line": 40, "column": 10 } } }, "right": { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 40, "column": 13 }, "end": { "line": 40, "column": 23 } } }, "property": { "type": "Identifier", "name": "fnFixed", "decorators": [], "loc": { "start": { "line": 40, "column": 24 }, "end": { "line": 40, "column": 31 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 40, "column": 13 }, "end": { "line": 40, "column": 31 } } }, "arguments": [ { "type": "BinaryExpression", "operator": "*", "left": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 40, "column": 32 }, "end": { "line": 40, "column": 42 } } }, "property": { "type": "Identifier", "name": "AG_CONST", "decorators": [], "loc": { "start": { "line": 40, "column": 43 }, "end": { "line": 40, "column": 51 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 40, "column": 32 }, "end": { "line": 40, "column": 51 } } }, "right": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "cos", "decorators": [], "loc": { "start": { "line": 40, "column": 54 }, "end": { "line": 40, "column": 57 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0, "loc": { "start": { "line": 40, "column": 58 }, "end": { "line": 40, "column": 59 } } } ], "optional": false, "loc": { "start": { "line": 40, "column": 54 }, "end": { "line": 40, "column": 60 } } }, "loc": { "start": { "line": 40, "column": 32 }, "end": { "line": 40, "column": 60 } } } ], "optional": false, "loc": { "start": { "line": 40, "column": 13 }, "end": { "line": 40, "column": 61 } } }, "loc": { "start": { "line": 40, "column": 9 }, "end": { "line": 40, "column": 61 } } }, "loc": { "start": { "line": 40, "column": 9 }, "end": { "line": 40, "column": 62 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 41, "column": 9 }, "end": { "line": 41, "column": 10 } } }, "right": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "sin", "decorators": [], "loc": { "start": { "line": 41, "column": 13 }, "end": { "line": 41, "column": 16 } } }, "arguments": [ { "type": "NumberLiteral", "value": 0, "loc": { "start": { "line": 41, "column": 17 }, "end": { "line": 41, "column": 18 } } } ], "optional": false, "loc": { "start": { "line": 41, "column": 13 }, "end": { "line": 41, "column": 19 } } }, "loc": { "start": { "line": 41, "column": 9 }, "end": { "line": 41, "column": 19 } } }, "loc": { "start": { "line": 41, "column": 9 }, "end": { "line": 41, "column": 20 } } }, { "type": "ForUpdateStatement", "init": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 42, "column": 14 }, "end": { "line": 42, "column": 18 } } }, "right": { "type": "NumberLiteral", "value": 0, "loc": { "start": { "line": 42, "column": 21 }, "end": { "line": 42, "column": 22 } } }, "loc": { "start": { "line": 42, "column": 14 }, "end": { "line": 42, "column": 22 } } }, "test": { "type": "BinaryExpression", "operator": "<", "left": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 42, "column": 24 }, "end": { "line": 42, "column": 28 } } }, "right": { "type": "NumberLiteral", "value": 12, "loc": { "start": { "line": 42, "column": 31 }, "end": { "line": 42, "column": 33 } } }, "loc": { "start": { "line": 42, "column": 24 }, "end": { "line": 42, "column": 33 } } }, "update": { "type": "UpdateExpression", "operator": "++", "prefix": false, "argument": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 42, "column": 35 }, "end": { "line": 42, "column": 39 } } }, "loc": { "start": { "line": 42, "column": 35 }, "end": { "line": 42, "column": 41 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "newX", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 43, "column": 24 }, "end": { "line": 43, "column": 30 } } }, "decorators": [], "loc": { "start": { "line": 43, "column": 17 }, "end": { "line": 43, "column": 21 } } }, "init": null, "loc": { "start": { "line": 43, "column": 17 }, "end": { "line": 43, "column": 21 } } } ], "kind": "let", "loc": { "start": { "line": 43, "column": 13 }, "end": { "line": 43, "column": 32 } } }, { "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": ">", "left": { "type": "Identifier", "name": "targetAngle", "decorators": [], "loc": { "start": { "line": 44, "column": 17 }, "end": { "line": 44, "column": 28 } } }, "right": { "type": "Identifier", "name": "currAngle", "decorators": [], "loc": { "start": { "line": 44, "column": 31 }, "end": { "line": 44, "column": 40 } } }, "loc": { "start": { "line": 44, "column": 17 }, "end": { "line": 44, "column": 40 } } }, "consequent": { "type": "BlockStatement", "statements": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "newX", "decorators": [], "loc": { "start": { "line": 45, "column": 17 }, "end": { "line": 45, "column": 21 } } }, "right": { "type": "BinaryExpression", "operator": "-", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 45, "column": 24 }, "end": { "line": 45, "column": 25 } } }, "right": { "type": "BinaryExpression", "operator": ">>", "left": { "type": "TSAsExpression", "expression": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 45, "column": 29 }, "end": { "line": 45, "column": 30 } } }, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 45, "column": 34 }, "end": { "line": 45, "column": 37 } } }, "loc": { "start": { "line": 45, "column": 29 }, "end": { "line": 45, "column": 30 } } }, "right": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 45, "column": 41 }, "end": { "line": 45, "column": 45 } } }, "loc": { "start": { "line": 45, "column": 28 }, "end": { "line": 45, "column": 46 } } }, "loc": { "start": { "line": 45, "column": 24 }, "end": { "line": 45, "column": 46 } } }, "loc": { "start": { "line": 45, "column": 17 }, "end": { "line": 45, "column": 46 } } }, "loc": { "start": { "line": 45, "column": 17 }, "end": { "line": 45, "column": 47 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 46, "column": 17 }, "end": { "line": 46, "column": 18 } } }, "right": { "type": "BinaryExpression", "operator": "+", "left": { "type": "BinaryExpression", "operator": ">>", "left": { "type": "TSAsExpression", "expression": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 46, "column": 22 }, "end": { "line": 46, "column": 23 } } }, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 46, "column": 27 }, "end": { "line": 46, "column": 30 } } }, "loc": { "start": { "line": 46, "column": 22 }, "end": { "line": 46, "column": 23 } } }, "right": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 46, "column": 34 }, "end": { "line": 46, "column": 38 } } }, "loc": { "start": { "line": 46, "column": 21 }, "end": { "line": 46, "column": 39 } } }, "right": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 46, "column": 42 }, "end": { "line": 46, "column": 43 } } }, "loc": { "start": { "line": 46, "column": 21 }, "end": { "line": 46, "column": 43 } } }, "loc": { "start": { "line": 46, "column": 17 }, "end": { "line": 46, "column": 43 } } }, "loc": { "start": { "line": 46, "column": 17 }, "end": { "line": 46, "column": 44 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 47, "column": 17 }, "end": { "line": 47, "column": 18 } } }, "right": { "type": "Identifier", "name": "newX", "decorators": [], "loc": { "start": { "line": 47, "column": 21 }, "end": { "line": 47, "column": 25 } } }, "loc": { "start": { "line": 47, "column": 17 }, "end": { "line": 47, "column": 25 } } }, "loc": { "start": { "line": 47, "column": 17 }, "end": { "line": 47, "column": 26 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "+=", "left": { "type": "Identifier", "name": "currAngle", "decorators": [], "loc": { "start": { "line": 48, "column": 17 }, "end": { "line": 48, "column": 26 } } }, "right": { "type": "MemberExpression", "object": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 48, "column": 30 }, "end": { "line": 48, "column": 40 } } }, "property": { "type": "Identifier", "name": "ANGLES", "decorators": [], "loc": { "start": { "line": 48, "column": 41 }, "end": { "line": 48, "column": 47 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 48, "column": 30 }, "end": { "line": 48, "column": 47 } } }, "property": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 48, "column": 48 }, "end": { "line": 48, "column": 52 } } }, "computed": true, "optional": false, "loc": { "start": { "line": 48, "column": 30 }, "end": { "line": 48, "column": 53 } } }, "loc": { "start": { "line": 48, "column": 17 }, "end": { "line": 48, "column": 53 } } }, "loc": { "start": { "line": 48, "column": 17 }, "end": { "line": 48, "column": 54 } } } ], "loc": { "start": { "line": 44, "column": 42 }, "end": { "line": 49, "column": 14 } } }, "alternate": { "type": "BlockStatement", "statements": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "newX", "decorators": [], "loc": { "start": { "line": 51, "column": 17 }, "end": { "line": 51, "column": 21 } } }, "right": { "type": "BinaryExpression", "operator": "+", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 51, "column": 24 }, "end": { "line": 51, "column": 25 } } }, "right": { "type": "BinaryExpression", "operator": ">>", "left": { "type": "TSAsExpression", "expression": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 51, "column": 29 }, "end": { "line": 51, "column": 30 } } }, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 51, "column": 34 }, "end": { "line": 51, "column": 37 } } }, "loc": { "start": { "line": 51, "column": 29 }, "end": { "line": 51, "column": 30 } } }, "right": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 51, "column": 41 }, "end": { "line": 51, "column": 45 } } }, "loc": { "start": { "line": 51, "column": 28 }, "end": { "line": 51, "column": 46 } } }, "loc": { "start": { "line": 51, "column": 24 }, "end": { "line": 51, "column": 46 } } }, "loc": { "start": { "line": 51, "column": 17 }, "end": { "line": 51, "column": 46 } } }, "loc": { "start": { "line": 51, "column": 17 }, "end": { "line": 51, "column": 47 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 52, "column": 17 }, "end": { "line": 52, "column": 18 } } }, "right": { "type": "BinaryExpression", "operator": "+", "left": { "type": "UnaryExpression", "operator": "-", "prefix": true, "argument": { "type": "BinaryExpression", "operator": ">>", "left": { "type": "TSAsExpression", "expression": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 52, "column": 23 }, "end": { "line": 52, "column": 24 } } }, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 52, "column": 28 }, "end": { "line": 52, "column": 31 } } }, "loc": { "start": { "line": 52, "column": 23 }, "end": { "line": 52, "column": 24 } } }, "right": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 52, "column": 35 }, "end": { "line": 52, "column": 39 } } }, "loc": { "start": { "line": 52, "column": 22 }, "end": { "line": 52, "column": 40 } } }, "loc": { "start": { "line": 52, "column": 21 }, "end": { "line": 52, "column": 40 } } }, "right": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 52, "column": 43 }, "end": { "line": 52, "column": 44 } } }, "loc": { "start": { "line": 52, "column": 21 }, "end": { "line": 52, "column": 44 } } }, "loc": { "start": { "line": 52, "column": 17 }, "end": { "line": 52, "column": 44 } } }, "loc": { "start": { "line": 52, "column": 17 }, "end": { "line": 52, "column": 45 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 53, "column": 17 }, "end": { "line": 53, "column": 18 } } }, "right": { "type": "Identifier", "name": "newX", "decorators": [], "loc": { "start": { "line": 53, "column": 21 }, "end": { "line": 53, "column": 25 } } }, "loc": { "start": { "line": 53, "column": 17 }, "end": { "line": 53, "column": 25 } } }, "loc": { "start": { "line": 53, "column": 17 }, "end": { "line": 53, "column": 26 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "-=", "left": { "type": "Identifier", "name": "currAngle", "decorators": [], "loc": { "start": { "line": 54, "column": 17 }, "end": { "line": 54, "column": 26 } } }, "right": { "type": "MemberExpression", "object": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 54, "column": 30 }, "end": { "line": 54, "column": 40 } } }, "property": { "type": "Identifier", "name": "ANGLES", "decorators": [], "loc": { "start": { "line": 54, "column": 41 }, "end": { "line": 54, "column": 47 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 54, "column": 30 }, "end": { "line": 54, "column": 47 } } }, "property": { "type": "Identifier", "name": "step", "decorators": [], "loc": { "start": { "line": 54, "column": 48 }, "end": { "line": 54, "column": 52 } } }, "computed": true, "optional": false, "loc": { "start": { "line": 54, "column": 30 }, "end": { "line": 54, "column": 53 } } }, "loc": { "start": { "line": 54, "column": 17 }, "end": { "line": 54, "column": 53 } } }, "loc": { "start": { "line": 54, "column": 17 }, "end": { "line": 54, "column": 54 } } } ], "loc": { "start": { "line": 50, "column": 18 }, "end": { "line": 55, "column": 14 } } }, "loc": { "start": { "line": 44, "column": 13 }, "end": { "line": 55, "column": 14 } } } ], "loc": { "start": { "line": 42, "column": 43 }, "end": { "line": 56, "column": 10 } } }, "loc": { "start": { "line": 42, "column": 9 }, "end": { "line": 56, "column": 10 } } }, { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "*", "left": { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 57, "column": 16 }, "end": { "line": 57, "column": 26 } } }, "property": { "type": "Identifier", "name": "fnFloat", "decorators": [], "loc": { "start": { "line": 57, "column": 27 }, "end": { "line": 57, "column": 34 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 57, "column": 16 }, "end": { "line": 57, "column": 34 } } }, "arguments": [ { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 57, "column": 35 }, "end": { "line": 57, "column": 36 } } } ], "optional": false, "loc": { "start": { "line": 57, "column": 16 }, "end": { "line": 57, "column": 37 } } }, "right": { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 57, "column": 40 }, "end": { "line": 57, "column": 50 } } }, "property": { "type": "Identifier", "name": "fnFloat", "decorators": [], "loc": { "start": { "line": 57, "column": 51 }, "end": { "line": 57, "column": 58 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 57, "column": 40 }, "end": { "line": 57, "column": 58 } } }, "arguments": [ { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 57, "column": 59 }, "end": { "line": 57, "column": 60 } } } ], "optional": false, "loc": { "start": { "line": 57, "column": 40 }, "end": { "line": 57, "column": 61 } } }, "loc": { "start": { "line": 57, "column": 16 }, "end": { "line": 57, "column": 61 } } }, "loc": { "start": { "line": 57, "column": 9 }, "end": { "line": 57, "column": 62 } } } ], "loc": { "start": { "line": 34, "column": 50 }, "end": { "line": 58, "column": 6 } } }, "loc": { "start": { "line": 34, "column": 24 }, "end": { "line": 58, "column": 6 } } }, "loc": { "start": { "line": 34, "column": 24 }, "end": { "line": 58, "column": 6 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 34, "column": 5 }, "end": { "line": 58, "column": 6 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "cordic", "decorators": [], "loc": { "start": { "line": 60, "column": 12 }, "end": { "line": 60, "column": 18 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "cordic", "decorators": [], "loc": { "start": { "line": 60, "column": 12 }, "end": { "line": 60, "column": 18 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "ETSParameterExpression", "name": { "type": "Identifier", "name": "runs", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 60, "column": 26 }, "end": { "line": 60, "column": 29 } } }, "decorators": [], "loc": { "start": { "line": 60, "column": 19 }, "end": { "line": 60, "column": 29 } } }, "loc": { "start": { "line": 60, "column": 19 }, "end": { "line": 60, "column": 29 } } } ], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 60, "column": 32 }, "end": { "line": 60, "column": 38 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "total", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 61, "column": 21 }, "end": { "line": 61, "column": 27 } } }, "decorators": [], "loc": { "start": { "line": 61, "column": 13 }, "end": { "line": 61, "column": 18 } } }, "init": { "type": "NumberLiteral", "value": 0, "loc": { "start": { "line": 61, "column": 30 }, "end": { "line": 61, "column": 31 } } }, "loc": { "start": { "line": 61, "column": 13 }, "end": { "line": 61, "column": 31 } } } ], "kind": "let", "loc": { "start": { "line": 61, "column": 9 }, "end": { "line": 61, "column": 32 } } }, { "type": "ForUpdateStatement", "init": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "i", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 62, "column": 22 }, "end": { "line": 62, "column": 25 } } }, "decorators": [], "loc": { "start": { "line": 62, "column": 18 }, "end": { "line": 62, "column": 19 } } }, "init": { "type": "NumberLiteral", "value": 0, "loc": { "start": { "line": 62, "column": 28 }, "end": { "line": 62, "column": 29 } } }, "loc": { "start": { "line": 62, "column": 18 }, "end": { "line": 62, "column": 29 } } } ], "kind": "let", "loc": { "start": { "line": 62, "column": 14 }, "end": { "line": 62, "column": 29 } } }, "test": { "type": "BinaryExpression", "operator": "<", "left": { "type": "Identifier", "name": "i", "decorators": [], "loc": { "start": { "line": 62, "column": 31 }, "end": { "line": 62, "column": 32 } } }, "right": { "type": "Identifier", "name": "runs", "decorators": [], "loc": { "start": { "line": 62, "column": 35 }, "end": { "line": 62, "column": 39 } } }, "loc": { "start": { "line": 62, "column": 31 }, "end": { "line": 62, "column": 39 } } }, "update": { "type": "UpdateExpression", "operator": "++", "prefix": false, "argument": { "type": "Identifier", "name": "i", "decorators": [], "loc": { "start": { "line": 62, "column": 41 }, "end": { "line": 62, "column": 42 } } }, "loc": { "start": { "line": 62, "column": 41 }, "end": { "line": 62, "column": 44 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "+=", "left": { "type": "Identifier", "name": "total", "decorators": [], "loc": { "start": { "line": 63, "column": 13 }, "end": { "line": 63, "column": 18 } } }, "right": { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 63, "column": 22 }, "end": { "line": 63, "column": 32 } } }, "property": { "type": "Identifier", "name": "cordicsincos", "decorators": [], "loc": { "start": { "line": 63, "column": 33 }, "end": { "line": 63, "column": 45 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 63, "column": 22 }, "end": { "line": 63, "column": 45 } } }, "arguments": [ { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 63, "column": 46 }, "end": { "line": 63, "column": 56 } } }, "property": { "type": "Identifier", "name": "TARGET_ANGLE", "decorators": [], "loc": { "start": { "line": 63, "column": 57 }, "end": { "line": 63, "column": 69 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 63, "column": 46 }, "end": { "line": 63, "column": 69 } } } ], "optional": false, "loc": { "start": { "line": 63, "column": 22 }, "end": { "line": 63, "column": 70 } } }, "loc": { "start": { "line": 63, "column": 13 }, "end": { "line": 63, "column": 70 } } }, "loc": { "start": { "line": 63, "column": 13 }, "end": { "line": 63, "column": 71 } } } ], "loc": { "start": { "line": 62, "column": 46 }, "end": { "line": 64, "column": 10 } } }, "loc": { "start": { "line": 62, "column": 9 }, "end": { "line": 64, "column": 10 } } }, { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "total", "decorators": [], "loc": { "start": { "line": 65, "column": 16 }, "end": { "line": 65, "column": 21 } } }, "loc": { "start": { "line": 65, "column": 9 }, "end": { "line": 65, "column": 22 } } } ], "loc": { "start": { "line": 60, "column": 39 }, "end": { "line": 66, "column": 6 } } }, "loc": { "start": { "line": 60, "column": 18 }, "end": { "line": 66, "column": 6 } } }, "loc": { "start": { "line": 60, "column": 18 }, "end": { "line": 66, "column": 6 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 60, "column": 5 }, "end": { "line": 66, "column": 6 } } }, { "type": "ClassProperty", "key": { "type": "Identifier", "name": "n", "decorators": [], "loc": { "start": { "line": 68, "column": 5 }, "end": { "line": 68, "column": 6 } } }, "accessibility": "public", "static": false, "readonly": false, "declare": false, "optional": false, "computed": false, "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 68, "column": 9 }, "end": { "line": 68, "column": 12 } } }, "definite": false, "decorators": [], "loc": { "start": { "line": 68, "column": 5 }, "end": { "line": 68, "column": 12 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "run", "decorators": [], "loc": { "start": { "line": 70, "column": 13 }, "end": { "line": 70, "column": 16 } } }, "kind": "method", "accessibility": "public", "static": false, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "run", "decorators": [], "loc": { "start": { "line": 70, "column": 13 }, "end": { "line": 70, "column": 16 } } }, "generator": false, "async": false, "expression": false, "params": [], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 70, "column": 20 }, "end": { "line": 70, "column": 24 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "object": { "type": "ThisExpression", "loc": { "start": { "line": 71, "column": 9 }, "end": { "line": 71, "column": 13 } } }, "property": { "type": "Identifier", "name": "n", "decorators": [], "loc": { "start": { "line": 71, "column": 14 }, "end": { "line": 71, "column": 15 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 71, "column": 9 }, "end": { "line": 71, "column": 15 } } }, "right": { "type": "NumberLiteral", "value": 25000, "loc": { "start": { "line": 71, "column": 18 }, "end": { "line": 71, "column": 23 } } }, "loc": { "start": { "line": 71, "column": 9 }, "end": { "line": 71, "column": 23 } } }, "loc": { "start": { "line": 71, "column": 9 }, "end": { "line": 71, "column": 24 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "total", "typeAnnotation": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 72, "column": 21 }, "end": { "line": 72, "column": 27 } } }, "decorators": [], "loc": { "start": { "line": 72, "column": 13 }, "end": { "line": 72, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 72, "column": 30 }, "end": { "line": 72, "column": 40 } } }, "property": { "type": "Identifier", "name": "cordic", "decorators": [], "loc": { "start": { "line": 72, "column": 41 }, "end": { "line": 72, "column": 47 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 72, "column": 30 }, "end": { "line": 72, "column": 47 } } }, "arguments": [ { "type": "MemberExpression", "object": { "type": "ThisExpression", "loc": { "start": { "line": 72, "column": 48 }, "end": { "line": 72, "column": 52 } } }, "property": { "type": "Identifier", "name": "n", "decorators": [], "loc": { "start": { "line": 72, "column": 53 }, "end": { "line": 72, "column": 54 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 72, "column": 48 }, "end": { "line": 72, "column": 54 } } } ], "optional": false, "loc": { "start": { "line": 72, "column": 30 }, "end": { "line": 72, "column": 55 } } }, "loc": { "start": { "line": 72, "column": 13 }, "end": { "line": 72, "column": 55 } } } ], "kind": "let", "loc": { "start": { "line": 72, "column": 9 }, "end": { "line": 72, "column": 56 } } }, { "type": "AssertStatement", "test": { "type": "BinaryExpression", "operator": "==", "left": { "type": "Identifier", "name": "total", "decorators": [], "loc": { "start": { "line": 74, "column": 16 }, "end": { "line": 74, "column": 21 } } }, "right": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 74, "column": 25 }, "end": { "line": 74, "column": 35 } } }, "property": { "type": "Identifier", "name": "expected", "decorators": [], "loc": { "start": { "line": 74, "column": 36 }, "end": { "line": 74, "column": 44 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 74, "column": 25 }, "end": { "line": 74, "column": 44 } } }, "loc": { "start": { "line": 74, "column": 16 }, "end": { "line": 74, "column": 44 } } }, "second": { "type": "StringLiteral", "value": "Incorrect result", "loc": { "start": { "line": 74, "column": 46 }, "end": { "line": 74, "column": 64 } } }, "loc": { "start": { "line": 74, "column": 9 }, "end": { "line": 74, "column": 65 } } } ], "loc": { "start": { "line": 70, "column": 25 }, "end": { "line": 75, "column": 6 } } }, "loc": { "start": { "line": 70, "column": 16 }, "end": { "line": 75, "column": 6 } } }, "loc": { "start": { "line": 70, "column": 16 }, "end": { "line": 75, "column": 6 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 70, "column": 5 }, "end": { "line": 75, "column": 6 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "constructor", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "kind": "constructor", "static": false, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "constructor", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "generator": false, "async": false, "expression": false, "params": [], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 76, "column": 2 }, "end": { "line": 76, "column": 2 } } } ], "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 76, "column": 2 } } }, "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 76, "column": 2 } } }, { "type": "ClassDeclaration", "definition": { "id": { "type": "Identifier", "name": "ETSGLOBAL", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "superClass": null, "implements": [], "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "_$init$_", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "_$init$_", "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "generator": false, "async": false, "expression": false, "params": [], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "main", "decorators": [], "loc": { "start": { "line": 78, "column": 10 }, "end": { "line": 78, "column": 14 } } }, "kind": "method", "accessibility": "public", "static": true, "optional": false, "computed": false, "value": { "type": "FunctionExpression", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "main", "decorators": [], "loc": { "start": { "line": 78, "column": 10 }, "end": { "line": 78, "column": 14 } } }, "generator": false, "async": false, "expression": false, "params": [], "returnType": { "type": "ETSPrimitiveType", "loc": { "start": { "line": 78, "column": 18 }, "end": { "line": 78, "column": 22 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 79, "column": 7 }, "end": { "line": 79, "column": 8 } } }, "init": { "type": "ETSNewClassInstanceExpression", "typeReference": { "type": "ETSTypeReference", "part": { "type": "ETSTypeReferencePart", "name": { "type": "Identifier", "name": "MathCordic", "decorators": [], "loc": { "start": { "line": 79, "column": 15 }, "end": { "line": 79, "column": 25 } } }, "loc": { "start": { "line": 79, "column": 15 }, "end": { "line": 79, "column": 26 } } }, "loc": { "start": { "line": 79, "column": 15 }, "end": { "line": 79, "column": 26 } } }, "arguments": [], "loc": { "start": { "line": 79, "column": 11 }, "end": { "line": 79, "column": 26 } } }, "loc": { "start": { "line": 79, "column": 7 }, "end": { "line": 79, "column": 26 } } } ], "kind": "let", "loc": { "start": { "line": 79, "column": 3 }, "end": { "line": 79, "column": 26 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "object": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 80, "column": 3 }, "end": { "line": 80, "column": 4 } } }, "property": { "type": "Identifier", "name": "run", "decorators": [], "loc": { "start": { "line": 80, "column": 5 }, "end": { "line": 80, "column": 8 } } }, "computed": false, "optional": false, "loc": { "start": { "line": 80, "column": 3 }, "end": { "line": 80, "column": 8 } } }, "arguments": [], "optional": false, "loc": { "start": { "line": 80, "column": 3 }, "end": { "line": 80, "column": 10 } } }, "loc": { "start": { "line": 80, "column": 3 }, "end": { "line": 80, "column": 11 } } } ], "loc": { "start": { "line": 78, "column": 23 }, "end": { "line": 81, "column": 2 } } }, "loc": { "start": { "line": 78, "column": 14 }, "end": { "line": 81, "column": 2 } } }, "loc": { "start": { "line": 78, "column": 14 }, "end": { "line": 81, "column": 2 } } }, "overloads": [], "decorators": [], "loc": { "start": { "line": 78, "column": 1 }, "end": { "line": 81, "column": 2 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } }, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 1 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 82, "column": 1 } } }