Math.Atan2 Method
毕业刚到两年,结果连三角函数的性质、定义域、值域,图像等忘得一干二净。可能是在毕业前就已经忘掉了。
今天画个图需要算几个点的坐标。想起了,他但是很多东西都忘了。
折腾了半天才明白了一点儿,呵呵,
我这次用到了 Math.Tan,Math.Atan2 函数,下面把这两个函数在msdn上的解释拷贝到下面供以后方便查找。
Math.Tan Method
今天画个图需要算几个点的坐标。想起了,他但是很多东西都忘了。
折腾了半天才明白了一点儿,呵呵,
我这次用到了 Math.Tan,Math.Atan2 函数,下面把这两个函数在msdn上的解释拷贝到下面供以后方便查找。
Math.Tan Method
Returns the tangent of the specified angle.
Parameters
- a
-
An angle, measured in radians.
Return Value
The tangent of a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN.The angle, a, must be in radians. Multiply by π/180 to convert degrees to radians.
Math.Atan2 Method
Returns the angle whose tangent is the quotient of two specified numbers.
Parameters
- y
- The y coordinate of a point.
- x
- The x coordinate of a point.
Return Value
An angle, θ, measured in radians, such that -π≤θ≤π, and tan(θ) = y / x, where (x, y) is a point in the Cartesian plane. Observe the following:-
For (x, y) in quadrant 1, 0 < θ < π/2.
-
For (x, y) in quadrant 2, π/2 < θ≤π.
-
For (x, y) in quadrant 3, -π < θ < -π/2.
-
For (x, y) in quadrant 4, -π/2 < θ < 0.
The return value 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).