Math.Atan Method

Returns the angle that corresponds to a specified tangent value.

...Math.Atan(tangent )

Prerequisites

None

Parameters

tangent

A required expression that evaluates to the tangent of an angle.

Remarks

Returns the angle, in radians, that corresponds to a specified tangent value. That is, if the tangent of an angle A is B, then this arc tangent function returns A when given a value of B.

Since the tangent function repeats the same series of answers over two ranges of angles: when an angle traverses from 0 to π/2 as when an angle moves from -π to –π/2 and then again when an angle traverses from 0 to -π/2 as when an angle moves from -π to π/2, the Math.Atan function cannot distinguish these cases and always returns values that range from π/2 to -π/2.

In addition, as the angle gets close to π/2 or -π/2, the input parameter for this method must approach positive or negative infinity.

To deal with both of these problems, the Math.Atan2 method should be used whenever possible.

To convert radians to degrees, multiply the radians times 180/π.

Examples

Dim angle As Single
angle = Math.Atan(1) ' Sets angle to Pi/4
angle = Math.Atan(0) ' Sets angle to 0
angle = Math.Atan(Math.Tan(-3*Math.PI/4)) ' Sets angle to Pi/4

See Also

Math Class | Math.Atan2