With the help of atan2(y, x)
method, we can get the arc tangent between x axis and a vector from origin to (x, y) in R programming.
Syntax: atan2(y, x)
Return: Returns the arc tangent value.
Example 1:
x < - c( 2 , 3 , 4 )
gfg < - atan2( 1 , x)
print (gfg)
|
Output:
[1] 0.4636476 0.3217506 0.2449787
Example 2:
x < - c( 2 , 3 , 1 )
gfg < - atan2(pi / 3 , x)
print (gfg)
|
Output:
[1] 0.4823479 0.3358424 0.8084488
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
10 May, 2020
Like Article
Save Article