runmat 0.4.9-dev.2 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/artifacts/stdlib.snapshot +0 -0
  2. package/dist/builtins.d.ts +1 -0
  3. package/dist/builtins.d.ts.map +1 -1
  4. package/dist/builtins.js.map +1 -1
  5. package/dist/generated/builtin-examples-catalog.d.ts.map +1 -1
  6. package/dist/generated/builtin-examples-catalog.js +1 -1
  7. package/dist/generated/builtin-examples-catalog.js.map +1 -1
  8. package/dist/generated/builtins/complex.d.ts +4 -0
  9. package/dist/generated/builtins/complex.d.ts.map +1 -0
  10. package/dist/generated/builtins/complex.js +157 -0
  11. package/dist/generated/builtins/complex.js.map +1 -0
  12. package/dist/generated/builtins/cosd.d.ts +4 -0
  13. package/dist/generated/builtins/cosd.d.ts.map +1 -0
  14. package/dist/generated/builtins/cosd.js +109 -0
  15. package/dist/generated/builtins/cosd.js.map +1 -0
  16. package/dist/generated/builtins/db.d.ts +4 -0
  17. package/dist/generated/builtins/db.d.ts.map +1 -0
  18. package/dist/generated/builtins/db.js +122 -0
  19. package/dist/generated/builtins/db.js.map +1 -0
  20. package/dist/generated/builtins/fill3.d.ts +4 -0
  21. package/dist/generated/builtins/fill3.d.ts.map +1 -0
  22. package/dist/generated/builtins/fill3.js +152 -0
  23. package/dist/generated/builtins/fill3.js.map +1 -0
  24. package/dist/generated/builtins/fminbnd.d.ts +4 -0
  25. package/dist/generated/builtins/fminbnd.d.ts.map +1 -0
  26. package/dist/generated/builtins/fminbnd.js +104 -0
  27. package/dist/generated/builtins/fminbnd.js.map +1 -0
  28. package/dist/generated/builtins/integral.d.ts +4 -0
  29. package/dist/generated/builtins/integral.d.ts.map +1 -0
  30. package/dist/generated/builtins/integral.js +101 -0
  31. package/dist/generated/builtins/integral.js.map +1 -0
  32. package/dist/generated/builtins/mode.d.ts +4 -0
  33. package/dist/generated/builtins/mode.d.ts.map +1 -0
  34. package/dist/generated/builtins/mode.js +146 -0
  35. package/dist/generated/builtins/mode.js.map +1 -0
  36. package/dist/generated/builtins/optimset.d.ts.map +1 -1
  37. package/dist/generated/builtins/optimset.js +8 -4
  38. package/dist/generated/builtins/optimset.js.map +1 -1
  39. package/dist/generated/builtins/patch.d.ts +4 -0
  40. package/dist/generated/builtins/patch.d.ts.map +1 -0
  41. package/dist/generated/builtins/patch.js +135 -0
  42. package/dist/generated/builtins/patch.js.map +1 -0
  43. package/dist/generated/builtins/repelem.d.ts +4 -0
  44. package/dist/generated/builtins/repelem.d.ts.map +1 -0
  45. package/dist/generated/builtins/repelem.js +135 -0
  46. package/dist/generated/builtins/repelem.js.map +1 -0
  47. package/dist/generated/builtins/sawtooth.d.ts +4 -0
  48. package/dist/generated/builtins/sawtooth.d.ts.map +1 -0
  49. package/dist/generated/builtins/sawtooth.js +111 -0
  50. package/dist/generated/builtins/sawtooth.js.map +1 -0
  51. package/dist/generated/builtins/sinc.d.ts +4 -0
  52. package/dist/generated/builtins/sinc.d.ts.map +1 -0
  53. package/dist/generated/builtins/sinc.js +142 -0
  54. package/dist/generated/builtins/sinc.js.map +1 -0
  55. package/dist/generated/builtins/sind.d.ts +4 -0
  56. package/dist/generated/builtins/sind.d.ts.map +1 -0
  57. package/dist/generated/builtins/sind.js +109 -0
  58. package/dist/generated/builtins/sind.js.map +1 -0
  59. package/dist/generated/builtins/square.d.ts +4 -0
  60. package/dist/generated/builtins/square.d.ts.map +1 -0
  61. package/dist/generated/builtins/square.js +110 -0
  62. package/dist/generated/builtins/square.js.map +1 -0
  63. package/dist/generated/builtins/step.d.ts +4 -0
  64. package/dist/generated/builtins/step.d.ts.map +1 -0
  65. package/dist/generated/builtins/step.js +125 -0
  66. package/dist/generated/builtins/step.js.map +1 -0
  67. package/dist/generated/builtins/tand.d.ts +4 -0
  68. package/dist/generated/builtins/tand.d.ts.map +1 -0
  69. package/dist/generated/builtins/tand.js +109 -0
  70. package/dist/generated/builtins/tand.js.map +1 -0
  71. package/dist/generated/builtins-manifest.d.ts.map +1 -1
  72. package/dist/generated/builtins-manifest.js +323 -1
  73. package/dist/generated/builtins-manifest.js.map +1 -1
  74. package/dist/lsp/runmat_lsp.d.ts +2 -2
  75. package/dist/lsp/runmat_lsp.js +4 -4
  76. package/dist/lsp/runmat_lsp_bg.wasm +0 -0
  77. package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
  78. package/dist/pkg-web/runmat_wasm_web.d.ts +42 -42
  79. package/dist/pkg-web/runmat_wasm_web.js +85 -85
  80. package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
  81. package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +35 -35
  82. package/dist/runtime/stdlib.snapshot +0 -0
  83. package/package.json +1 -1
@@ -0,0 +1,110 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "square",
5
+ "category": "math/signal",
6
+ "keywords": [
7
+ "square",
8
+ "waveform",
9
+ "signal processing",
10
+ "duty cycle",
11
+ "periodic",
12
+ "elementwise"
13
+ ],
14
+ "summary": "Generate a periodic square wave with optional duty cycle.",
15
+ "references": [],
16
+ "gpu_support": {
17
+ "elementwise": true,
18
+ "reduction": false,
19
+ "precisions": [
20
+ "f64"
21
+ ],
22
+ "broadcasting": "elementwise",
23
+ "notes": "GPU inputs are gathered to the host so the reference implementation can guarantee MATLAB-compatible half-open duty-cycle semantics at the period boundary."
24
+ },
25
+ "fusion": {
26
+ "elementwise": false,
27
+ "reduction": false,
28
+ "max_inputs": 1,
29
+ "constants": "inline",
30
+ "notes": "Fusion is intentionally disabled for v1 because the duty-cycle comparison is cheap on the host and would not materially benefit from kernel fusion."
31
+ },
32
+ "requires_feature": null,
33
+ "tested": {
34
+ "unit": "builtins::math::signal::square::tests",
35
+ "integration": null
36
+ },
37
+ "description": "`y = square(t)` generates a square wave with period `2*pi` at the sample times in `t`, with values in `{-1, +1}`. `y = square(t, duty)` accepts an explicit duty cycle as a percentage in `[0, 100]`: the output is `+1` over the first `duty/100 * 2*pi` of every period and `-1` for the remainder. The default duty cycle is 50% so that `square` produces the standard symmetric square wave.",
38
+ "behaviors": [
39
+ "Operates element-wise on scalars, vectors, matrices, and N-D tensors; preserves input shape.",
40
+ "Reduces input modulo `2*pi` so the waveform is periodic across negative and positive sample times.",
41
+ "Uses half-open interval semantics: `+1` for `phi/(2*pi) < duty/100`, `-1` otherwise.",
42
+ "`duty = 0` produces a constant `-1` waveform; `duty = 100` produces a constant `+1` waveform.",
43
+ "Integer and logical inputs are promoted to double precision before evaluation.",
44
+ "Non-finite sample times (`NaN`, `+Inf`, `-Inf`) propagate as `NaN` element-wise, matching MATLAB.",
45
+ "Complex and text inputs are rejected with a builtin-scoped error.",
46
+ "Rejects `duty` values outside `[0, 100]` and non-scalar `duty` arguments."
47
+ ],
48
+ "examples": [
49
+ {
50
+ "description": "Default 50% duty cycle square wave",
51
+ "input": "t = 0:pi/4:2*pi;\ny = square(t)",
52
+ "output": "y = [1 1 1 1 -1 -1 -1 -1 1]"
53
+ },
54
+ {
55
+ "description": "25% duty cycle square wave",
56
+ "input": "t = 0:pi/4:2*pi;\ny = square(t, 25)",
57
+ "output": "y = [1 1 -1 -1 -1 -1 -1 -1 1]"
58
+ },
59
+ {
60
+ "description": "Constant outputs at the boundaries",
61
+ "input": "y = square([0 pi 2*pi], 100)",
62
+ "output": "y = [1 1 1]"
63
+ }
64
+ ],
65
+ "faqs": [
66
+ {
67
+ "question": "What happens exactly at the duty-cycle boundary?",
68
+ "answer": "RunMat uses half-open semantics: the boundary phase belongs to the negative half. With the default 50% duty cycle, `square(pi)` returns `-1`. This matches MATLAB's documented behaviour."
69
+ },
70
+ {
71
+ "question": "How do I produce a constant `+1` or `-1`?",
72
+ "answer": "Pass `duty = 100` for a constant `+1` waveform and `duty = 0` for a constant `-1` waveform."
73
+ },
74
+ {
75
+ "question": "Can `square` accept complex inputs?",
76
+ "answer": "No. `square` is defined on real samples and rejects complex inputs with a builtin-scoped error to match MATLAB."
77
+ }
78
+ ],
79
+ "links": [
80
+ {
81
+ "label": "sawtooth",
82
+ "url": "./sawtooth"
83
+ },
84
+ {
85
+ "label": "sin",
86
+ "url": "./sin"
87
+ },
88
+ {
89
+ "label": "cos",
90
+ "url": "./cos"
91
+ },
92
+ {
93
+ "label": "linspace",
94
+ "url": "./linspace"
95
+ }
96
+ ],
97
+ "source": {
98
+ "label": "`crates/runmat-runtime/src/builtins/math/signal/square.rs`",
99
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/math/signal/square.rs"
100
+ },
101
+ "key": "square",
102
+ "slug": "square",
103
+ "aliases": [],
104
+ "categoryPath": [
105
+ "math",
106
+ "signal"
107
+ ]
108
+ };
109
+ export default builtinDoc;
110
+ //# sourceMappingURL=square.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"square.js","sourceRoot":"","sources":["../../../src/generated/builtins/square.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,QAAQ;QACR,UAAU;QACV,mBAAmB;QACnB,YAAY;QACZ,UAAU;QACV,aAAa;KACd;IACD,SAAS,EAAE,2DAA2D;IACtE,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE;QACb,aAAa,EAAE,IAAI;QACnB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE;YACZ,KAAK;SACN;QACD,cAAc,EAAE,aAAa;QAC7B,OAAO,EAAE,4JAA4J;KACtK;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;QACrB,OAAO,EAAE,qJAAqJ;KAC/J;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,uC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from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/step.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAwHjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,125 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "step",
5
+ "category": "control",
6
+ "keywords": [
7
+ "step",
8
+ "step response",
9
+ "control system",
10
+ "transfer function",
11
+ "tf"
12
+ ],
13
+ "summary": "Compute or plot the step response of a SISO transfer-function model.",
14
+ "references": [
15
+ "title: \"MATLAB step documentation\""
16
+ ],
17
+ "gpu_support": {
18
+ "elementwise": false,
19
+ "reduction": false,
20
+ "precisions": [],
21
+ "broadcasting": "none",
22
+ "notes": "`step` simulates host-side transfer-function metadata. GPU inputs are not part of the initial `tf` object response path."
23
+ },
24
+ "fusion": {
25
+ "elementwise": false,
26
+ "reduction": false,
27
+ "max_inputs": 0,
28
+ "constants": "inline",
29
+ "notes": "`step` is not fused; it simulates a dynamic system and may render a plot."
30
+ },
31
+ "requires_feature": null,
32
+ "tested": {
33
+ "unit": "builtins::control::step::tests",
34
+ "integration": "crates/runmat-vm/tests/control.rs"
35
+ },
36
+ "description": "`step(sys)` plots the unit-step response of a SISO transfer-function object created by `tf`. `[y, tOut] = step(sys)` returns sampled response data and the time vector. `step(sys, tFinal)` uses a scalar final time, while `step(sys, t)` evaluates at an explicit time vector.",
37
+ "behaviors": [
38
+ "Supports SISO `tf` objects with real coefficients.",
39
+ "Returns the response `y` as a column vector for single-output calls.",
40
+ "Returns `[y, tOut]` for two-output calls.",
41
+ "Plots the response for no-output calls.",
42
+ "Chooses an automatic time vector when no time input is supplied.",
43
+ "Accepts a positive finite scalar final time.",
44
+ "Accepts a finite, nonnegative, nondecreasing explicit time vector.",
45
+ "Discrete-time models use the stored `Ts` sample time."
46
+ ],
47
+ "examples": [
48
+ {
49
+ "description": "Returning response data for a first-order system",
50
+ "input": "sys = tf(1, [1 1]);\n[y, t] = step(sys);",
51
+ "output": "y and t are column vectors."
52
+ },
53
+ {
54
+ "description": "Using a scalar final time",
55
+ "input": "sys = tf(1, [1 1]);\n[y, t] = step(sys, 5);",
56
+ "output": "t(end) = 5"
57
+ },
58
+ {
59
+ "description": "Using an explicit time vector",
60
+ "input": "sys = tf(1, [1 1]);\nt = 0:0.5:2;\ny = step(sys, t);",
61
+ "output": "y is sampled at the values in t."
62
+ },
63
+ {
64
+ "description": "Plotting the step response",
65
+ "input": "sys = tf(1, [1 1]);\nstep(sys);",
66
+ "output": "A step-response plot is rendered."
67
+ }
68
+ ],
69
+ "faqs": [
70
+ {
71
+ "question": "Does `step` support MIMO models?",
72
+ "answer": "Not yet. This implementation starts with SISO transfer-function objects."
73
+ },
74
+ {
75
+ "question": "Does `step` support state-space models?",
76
+ "answer": "Not yet. The initial implementation supports transfer-function objects produced by `tf`."
77
+ },
78
+ {
79
+ "question": "Can transfer-function coefficients be complex?",
80
+ "answer": "Not in this first implementation. Complex coefficients return a clear unsupported-input error."
81
+ }
82
+ ],
83
+ "links": [
84
+ {
85
+ "label": "tf",
86
+ "url": "./tf"
87
+ },
88
+ {
89
+ "label": "plot",
90
+ "url": "./plot"
91
+ }
92
+ ],
93
+ "source": {
94
+ "label": "`crates/runmat-runtime/src/builtins/control/step.rs`",
95
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/step.rs"
96
+ },
97
+ "syntax": {
98
+ "example": {
99
+ "description": "Supported forms",
100
+ "input": "step(sys)\ny = step(sys)\n[y, tOut] = step(sys)\n[y, tOut] = step(sys, tFinal)\n[y, tOut] = step(sys, t)",
101
+ "output": "Response data is returned when outputs are requested; otherwise a plot is rendered."
102
+ },
103
+ "points": [
104
+ "`sys` must be a SISO `tf` object.",
105
+ "`tFinal` is a positive finite scalar final time.",
106
+ "`t` is a finite, nonnegative, nondecreasing numeric time vector."
107
+ ]
108
+ },
109
+ "validation": {
110
+ "summary": "`step` validates object class, coefficient type, properness, sample time, and time-vector inputs before simulation. Unit and integration tests cover first-order response values, scalar final time, explicit vectors, discrete sample-time behavior, multi-output ordering, and VM dispatch.",
111
+ "implementation": {
112
+ "label": "`crates/runmat-runtime/src/builtins/control/step.rs`",
113
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/step.rs"
114
+ }
115
+ },
116
+ "gpu_residency": "`step` computes on the host from `tf` metadata and returns host tensors.",
117
+ "key": "step",
118
+ "slug": "step",
119
+ "aliases": [],
120
+ "categoryPath": [
121
+ "control"
122
+ ]
123
+ };
124
+ export default builtinDoc;
125
+ //# sourceMappingURL=step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.js","sourceRoot":"","sources":["../../../src/generated/builtins/step.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE;QACV,MAAM;QACN,eAAe;QACf,gBAAgB;QAChB,mBAAmB;QACnB,IAAI;KACL;IACD,SAAS,EAAE,sEAAsE;IACjF,YAAY,EAAE;QACZ,sCAAsC;KACvC;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,0HAA0H;KACpI;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;QACrB,OAAO,EAAE,2EAA2E;KACrF;IACD,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;YACnC,kDAAkD;YAClD,kEAAkE;SACnE;KACF;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,+RAA+R;QAC1S,gBAAgB,EAAE;YAChB,OAAO,EAAE,sDAAsD;YAC/D,KAAK,EAAE,mGAAmG;SAC3G;KACF;IACD,eAAe,EAAE,0EAA0E;IAC3F,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,SAAS;KACV;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=tand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tand.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/tand.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAwGjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,109 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "tand",
5
+ "category": "math/trigonometry",
6
+ "keywords": [
7
+ "tand",
8
+ "tangent",
9
+ "degrees",
10
+ "angle",
11
+ "trigonometry",
12
+ "elementwise"
13
+ ],
14
+ "summary": "Tangent of angles expressed in degrees with MATLAB-exact poles at +/-90 and exact zeros at multiples of 180.",
15
+ "references": [],
16
+ "gpu_support": {
17
+ "elementwise": true,
18
+ "reduction": false,
19
+ "precisions": [
20
+ "f64"
21
+ ],
22
+ "broadcasting": "elementwise",
23
+ "notes": "GPU inputs are gathered to the host so the reference implementation can guarantee MATLAB-exact values at canonical multiples of 45, 90, and 180 degrees, including the +/-Inf poles at +/-90."
24
+ },
25
+ "fusion": {
26
+ "elementwise": false,
27
+ "reduction": false,
28
+ "max_inputs": 1,
29
+ "constants": "inline",
30
+ "notes": "Fusion is intentionally disabled for v1 because the WGSL `tan(x*pi/180)` form would replace MATLAB's +/-Inf poles with very large but finite values."
31
+ },
32
+ "requires_feature": null,
33
+ "tested": {
34
+ "unit": "builtins::math::trigonometry::tand::tests",
35
+ "integration": null
36
+ },
37
+ "description": "`y = tand(x)` evaluates the tangent of each angle in `x`, interpreting the values in degrees rather than radians. The implementation reduces the angle modulo 360 and special-cases 0, 45, 90, 135, and 180 (and their negative/wrapped counterparts) so multiples of 180 return an exact 0, multiples of 45 return ±1, and the poles at +90 and -90 return +Inf and -Inf respectively.",
38
+ "behaviors": [
39
+ "Operates element-wise on scalars, vectors, matrices, and N-D tensors.",
40
+ "Integer and logical inputs are promoted to double precision before evaluation.",
41
+ "Returns exactly 0 at multiples of 180 and exactly ±1 at multiples of 45.",
42
+ "Returns +Inf at +90 (and angles equivalent under modulo 360) and -Inf at -90 (and equivalent angles).",
43
+ "Complex inputs delegate to the analytic extension of `tan` after scaling by `pi/180`; exact-value treatment for complex operands is deferred.",
44
+ "Output shape matches the input shape; non-finite inputs propagate as `NaN`.",
45
+ "String inputs are unsupported and raise a builtin-scoped error."
46
+ ],
47
+ "examples": [
48
+ {
49
+ "description": "Tangent of a canonical degree angle",
50
+ "input": "y = tand(45)",
51
+ "output": "y = 1"
52
+ },
53
+ {
54
+ "description": "Tangent at the +/-90 poles returns +/-Inf",
55
+ "input": "y = tand([90 -90])",
56
+ "output": "y = [Inf -Inf]"
57
+ },
58
+ {
59
+ "description": "Tangent of a multiple of 180 returns exactly zero",
60
+ "input": "y = tand(180)",
61
+ "output": "y = 0"
62
+ }
63
+ ],
64
+ "faqs": [
65
+ {
66
+ "question": "Why does `tand(90)` return Inf instead of a very large finite number?",
67
+ "answer": "MATLAB defines `tand(90) = Inf` and `tand(-90) = -Inf` at the poles. Naively evaluating `tan(90*pi/180)` would return a huge finite number because `pi/180` is not exact in floating point, so RunMat short-circuits the poles to match MATLAB."
68
+ },
69
+ {
70
+ "question": "Is `tand(x)` equivalent to `tan(x*pi/180)`?",
71
+ "answer": "Mathematically yes, but the floating-point result differs at canonical angles. `tand` guarantees exact values at multiples of 45 and 180, and infinite values at +/-90."
72
+ },
73
+ {
74
+ "question": "Does `tand` support arrays?",
75
+ "answer": "Yes. Scalars, vectors, matrices, and N-D tensors are all handled element-wise; the shape of the input is preserved."
76
+ }
77
+ ],
78
+ "links": [
79
+ {
80
+ "label": "sind",
81
+ "url": "./sind"
82
+ },
83
+ {
84
+ "label": "cosd",
85
+ "url": "./cosd"
86
+ },
87
+ {
88
+ "label": "tan",
89
+ "url": "./tan"
90
+ },
91
+ {
92
+ "label": "deg2rad",
93
+ "url": "./deg2rad"
94
+ }
95
+ ],
96
+ "source": {
97
+ "label": "`crates/runmat-runtime/src/builtins/math/trigonometry/tand.rs`",
98
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/math/trigonometry/tand.rs"
99
+ },
100
+ "key": "tand",
101
+ "slug": "tand",
102
+ "aliases": [],
103
+ "categoryPath": [
104
+ "math",
105
+ "trigonometry"
106
+ ]
107
+ };
108
+ export default builtinDoc;
109
+ //# sourceMappingURL=tand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tand.js","sourceRoot":"","sources":["../../../src/generated/builtins/tand.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE;QACV,MAAM;QACN,SAAS;QACT,SAAS;QACT,OAAO;QACP,cAAc;QACd,aAAa;KACd;IACD,SAAS,EAAE,8GAA8G;IACzH,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE;QACb,aAAa,EAAE,IAAI;QACnB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE;YACZ,KAAK;SACN;QACD,cAAc,EAAE,aAAa;QAC7B,OAAO,EAAE,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G;KACrH;IACD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,cAAc;KACf;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EA47PjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAmZ9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
1
+ {"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EA+uQjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAka9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}