ATAN (math/atan/float)
The ATAN node calculates the arctangent (inverse tangent) of a given input value. It takes a single floating-point number as input and outputs the corresponding angle in radians.Inputs
a(float, default: 0): The input value for which to calculate the arctangent.
Outputs
result(float): The arctangent of the input value, in radians.
Configuration
This node has no additional configuration options.Usage
To use the ATAN node:- Connect a floating-point value to the
ainput port. This represents the value for which you want to calculate the arctangent. - The node will output the arctangent of the input value, in radians, through the
resultoutput port. - Connect the
resultoutput to the desired destination node(s) in your spell.
Example
Suppose you have a spell that needs to calculate the angle of a line given its slope. You can use the ATAN node to achieve this:- Connect the slope value (rise over run) to the
ainput of the ATAN node. - The node will calculate the arctangent of the slope and output the angle in radians.
- You can then use this angle value for further calculations or visualizations in your spell.
Best Practices
- Ensure that the input value is a valid floating-point number. The ATAN node expects a numerical input.
- Keep in mind that the output is in radians. If you need the angle in degrees, you can use the
math/rad2degnode to convert from radians to degrees.
Common Issues
- If the input is not a valid floating-point number, the node may output unexpected results or cause errors in the spell. Make sure to validate and sanitize input data before connecting it to the ATAN node.
