[Android] Support of trigonometric functions

commit_hash:1839cd815175c28091a555cdc5830c286070b3fa
This commit is contained in:
xvegau
2025-04-25 19:28:12 +03:00
parent 5f56b82134
commit c3eb077053
4 changed files with 187 additions and 0 deletions
@@ -89,6 +89,7 @@
],
"result_type": "number",
"platforms": [
"android",
"ios",
"web"
]
@@ -120,6 +121,7 @@
],
"result_type": "number",
"platforms": [
"android",
"ios",
"web"
]
@@ -135,10 +137,29 @@
],
"result_type": "number",
"platforms": [
"android",
"ios",
"web"
]
},
{
"function_name": "atan2",
"doc": "Calculates the angle in radians for given values (y,x)",
"arguments": [
{
"type": "number",
"doc": "Y coordinate of the point"
},
{
"type": "number",
"doc": "X coordinate of the point"
}
],
"result_type": "number",
"platforms": [
"android"
]
},
{
"function_name": "cot",
"doc": "Calculates the cotangent of the given angle in radians",
@@ -191,6 +191,7 @@
"value": 0.0
},
"platforms": [
"android",
"ios",
"web"
]
@@ -202,6 +203,7 @@
"value": 1.55740772465
},
"platforms": [
"android",
"ios",
"web"
]
@@ -220,6 +222,7 @@
}
],
"platforms": [
"android",
"ios",
"web"
]
@@ -297,6 +300,7 @@
"value": 1.570796326795
},
"platforms": [
"android",
"ios",
"web"
]
@@ -308,6 +312,7 @@
"value": 0.0
},
"platforms": [
"android",
"ios",
"web"
]
@@ -319,6 +324,7 @@
"value": 2.094395102393
},
"platforms": [
"android",
"ios",
"web"
]
@@ -341,6 +347,7 @@
"value": 0.0
},
"platforms": [
"android",
"ios",
"web"
]
@@ -352,6 +359,7 @@
"value": 0.665773750028
},
"platforms": [
"android",
"ios",
"web"
]
@@ -370,10 +378,83 @@
}
],
"platforms": [
"android",
"ios",
"web"
]
},
{
"expression": "@{atan2(y,x)}",
"expected": {
"type": "number",
"value": 0.78539816340
},
"variables": [
{
"name": "y",
"type": "number",
"value": 1.0
},
{
"name": "x",
"type": "number",
"value": 1.0
}
],
"platforms": [
"android"
]
},
{
"expression": "@{atan2(0.0,0.0)}",
"expected": {
"type": "number",
"value": 0.0
},
"platforms": [
"android"
]
},
{
"expression": "@{atan2(0.0,1.0)}",
"expected": {
"type": "number",
"value": 0.0
},
"platforms": [
"android"
]
},
{
"expression": "@{atan2(0.0,-1.0)}",
"expected": {
"type": "number",
"value": 3.141592653589793
},
"platforms": [
"android"
]
},
{
"expression": "@{atan2(1.0,0.0)}",
"expected": {
"type": "number",
"value": 1.5707963267948966
},
"platforms": [
"android"
]
},
{
"expression": "@{atan2(-1.0,0.0)}",
"expected": {
"type": "number",
"value": -1.5707963267948966
},
"platforms": [
"android"
]
},
{
"expression": "@{cot(0.0)}",
"expected": {