Complex.Tan(Complex) 方法

定义

返回指定复数的正切值。

public:
 static System::Numerics::Complex Tan(System::Numerics::Complex value);
public static System.Numerics.Complex Tan (System.Numerics.Complex value);
static member Tan : System.Numerics.Complex -> System.Numerics.Complex
Public Shared Function Tan (value As Complex) As Complex

参数

value
Complex

一个复数。

返回

value 的正切值。

示例

以下示例演示 了 Tan 方法。 它表明,将 方法返回 Atan 的值传递给 Tan 方法将返回原始 Complex 值。

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex[] values = { new Complex(2.5, 1.5),
                           new Complex(2.5, -1.5),
                           new Complex(-2.5, 1.5),
                           new Complex(-2.5, -1.5) };
      foreach (Complex value in values)
         Console.WriteLine("Tan(Atan({0})) = {1}",
                            value, Complex.Tan(Complex.Atan(value)));
   }
}
// The example displays the following output:
//       Tan(Atan((2.5, 1.5))) = (2.5, 1.5)
//       Tan(Atan((2.5, -1.5))) = (2.5, -1.5)
//       Tan(Atan((-2.5, 1.5))) = (-2.5, 1.5)
//       Tan(Atan((-2.5, -1.5))) = (-2.5, -1.5)
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim values() As Complex = { New Complex(2.5, 1.5), 
                                  New Complex(2.5, -1.5), 
                                  New Complex(-2.5, 1.5), 
                                  New Complex(-2.5, -1.5) }
      For Each value As Complex In values
         Console.WriteLine("Tan(Atan({0})) = {1}", 
                            value, Complex.Tan(Complex.Atan(value)))
      Next                               
   End Sub
End Module
' The example displays the following example:
'       Tan(Atan((2.5, 1.5))) = (2.5, 1.5)
'       Tan(Atan((2.5, -1.5))) = (2.5, -1.5)
'       Tan(Atan((-2.5, 1.5))) = (-2.5, 1.5)
'       Tan(Atan((-2.5, -1.5))) = (-2.5, -1.5)

注解

Tan复数的 方法对应于Math.Tan实数的 方法。

方法 Tan 使用以下公式计算复数 value的正切:

Sin(value) / Cos(value)

适用于

另请参阅