Full Library / Math Operator / Math and Trig / TrigFunction
Block Name: TrigFunction
Code File Location: VisualSim/actor/lib/TrigFunction
Block Overview
- Produce an output token on each firing with a value that is equal to the specified trigonometric function of the input. The input and output types are DoubleToken. The functions are exactly those in the java.lang.Math class. They are:
- acos: The arc cosine of an angle, in the range from 0.0 through pi. If the argument is NaN or its absolute value is greater than 1, then the result is NaN.
- asin: The arc sine of an angle, in the range of -pi/2 through pi/2. If the argument is NaN or its absolute value is greater than 1, then the result is NaN. If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then the result is negative zero.
- atan: The arc tangent of an angle, in the range of -pi/2 through pi/2. If the argument is NaN, then the result is NaN. If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then the result is negative zero.
- cos: The trigonometric cosine of an angle. If the argument is NaN or an infinity, then the result is NaN.
- sin: The trigonometric sine of an angle. If the argument is NaN or an infinity, then the result is NaN.
- tan: The trigonometric tangent of an angle. If the argument is NaN or an infinity, then the result is NaN. If the argument is positive zero, then the result is positive zero; if the argument is negative zero, then the result is negative zero
(NOTE: The above documentation is adapted from the class documentation for java.lang.Math as released in JDK 1.3).
(NOTE: This actor will eventually be augmented to do hyperbolic trig functions, and possibly to operate on matrices and arrays).
The following functions in java.lang.Math are implemented elsewhere:
- abs: AbsoluteValue actor.
- atan2: CartesianToPolar actor.
- ceil: Round actor
- exp: MathFunction actor.
- floor: Round actor
- remainder: MathFunction actor.
- log: MathFunction actor.
- max: Maximum actor.
- min: Minimum actor.
- round: Round actor.
- sqrt: MathFunction actor.
- toDegrees: Scale actor (with factor 180.0/PI).
- toRadians: Scale actor (with factor PI/180.0).
function
public StringAttribute function
- The function to compute. This is a string-valued attribute that defaults to "sin".
Created with the Personal Edition of HelpNDoc: Full-featured Kindle eBooks generator