Atan2 Function


Atan2 Function

Class

System.Math

Syntax

     Dim result As Double = Math.Atan2(y, x) 


x (required; Double)

The x-coordinate of a point


y (required; Double)

The y-coordinate of a point

Description

The Atan2 function returns the arctangent of the ratio x/y in radians. This is the angle in the Cartesian plane formed by the x-axis and a vector starting from the origin (0,0) and terminating at the point (x, y). More specifically, the return value satisfies the following:

  • For (x, y) in quadrant 1, 0 < result < p/2.

  • For (x, y) in quadrant 2, p/2 < result < p.

  • For (x, y) in quadrant 3, p < result < p/2.

  • For (x, y) in quadrant 4, p/2 < result < 0.

Usage at a Glance

This is a shared member of the System.Math class, so it can be used without an instance.

Version Differences

The Atan2 function does not exist in VB 6.

See Also

Acos Function, Asin Function, Atan Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net