Trigonometric
MathThe Trigonometric block provides 7 trigonometric functions in a single configurable block:
- sin(x) - Sine
- cos(x) - Cosine
- tan(x) - Tangent
- asin(x) - Arcsine (inverse sine)
- acos(x) - Arccosine (inverse cosine)
- atan(x) - Arctangent (inverse tangent)
- atan2(y,x) - Two-argument arctangent
Mathematical Model
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
Input | number | Required |
| → In | in2 |
X (atan2) | number | Required |
| ← Out | out |
Output | number | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
function |
Function | select | sin |
Usage Examples
Sine Wave Generation
Ramp (0 to 2π) → Trigonometric(sin) → uPlotDisplay
Full Angle Recovery with atan2
sin_signal → Trigonometric(atan2) ← cos_signal
↓
Angle (radians)Remarks & Best Practices
- Angle units: All trigonometric functions use radians; convert degrees to radians via Gain(× π/180)
- tan singularities: tan(x) approaches ±∞ at x = π/2 + nπ; place a Saturation block after tan if your signal crosses these points
- atan2: The two-argument arctangent recovers the full angle (−π, π] from (y, x) coordinates; connect y to
inand x toin2 - asin/acos clamping: Input values outside [−1, 1] are automatically clamped; consider a Saturation block beforehand for explicit bounds
- Periodic outputs: sin/cos outputs are bounded to [−1, 1]; scale with Gain to match your signal range
Related Components
Gain,Saturation- Signal conditioningSignalGenerator- Alternative sinusoidal sourceMathFunction- Other mathematical operations