Tan Block
Trigonometric tangent function: y = tan(u)
Open Tan in BlockWerk →# Tan Block Documentation
Overview
The Tan block computes the tangent trigonometric function of the input signal.
Inputs
- Input (rad): A numeric signal in radians
Outputs
- tan(x): The tangent of the input
Parameters
None
Mathematical Definition
y(t) = tan(u(t)) = sin(u(t)) / cos(u(t))
Behavior
- Input range: Any real number except odd multiples of π/2 (where cos = 0)
- Output range: All real numbers (-∞ to +∞)
- Function has vertical asymptotes at ±π/2, ±3π/2, etc.
- Period: π (not 2π like sin/cos)
Examples
Example 1: Basic Tangent
- Input: 0 → Output: 0
- Input: π/4 → Output: 1
- Input: π/3 → Output: √3 ≈ 1.732
- Input: π/2 → Output: undefined (asymptote)
Example 2: Angle-to-Slope Conversion
Tan is useful for converting angles to slopes:
Angle (radians) → Tan → Slope (rise/run)
Common Use Cases
1. Angle-to-slope conversion: Get slope from angle 2. Inverse kinematics: Atan2 for angle from x,y coordinates 3. Signal processing: Nonlinear transformations 4. Feedback control: Tangent as a nonlinear sensor characteristic
Numerical Stability
- Caution: Tan has singularities at odd multiples of π/2
- Recommendation: Add bounds checking to avoid asymptotes
- Use with caution when input angles are not constrained
See Also
Sin- Sine functionCos- Cosine functionArcTan- Inverse tangent