Complex.Conjugate Method
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Computes the conjugate of a complex number and returns the result.
Namespace: System.Numerics
Assembly: System.Numerics (in System.Numerics.dll)
Syntax
'Declaration
Public Shared Function Conjugate ( _
value As Complex _
) As Complex
public static Complex Conjugate(
Complex value
)
Parameters
- value
Type: System.Numerics.Complex
A complex number.
Return Value
Type: System.Numerics.Complex
The conjugate of value.
Remarks
The conjugate of a complex number inverts the sign of the imaginary component; that is, it applies unary negation to the imaginary component. If a + bi is a complex number, its conjugate is a - bi.
Examples
The following example displays the conjugate of two complex numbers.
Imports System.Numerics
Module Example
Public Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
Dim values() As Complex = { New Complex(12.4, 6.3),
New Complex(12.4, -6.3) }
For Each value In values
outputBlock.Text += String.Format("Original value: {0}", value) + vbCrLf
outputBlock.Text += String.Format("Conjugate: {0}",
Complex.Conjugate(value).ToString()) + vbCrLf
outputBlock.Text &= vbCrLf
Next
End Sub
End Module
' The example displays the following output:
' Original value: (12.4, 6.3)
' Conjugate: (12.4, -6.3)
'
' Original value: (12.4, -6.3)
' Conjugate: (12.4, 6.3)
using System;
using System.Numerics;
public class Example
{
public static void Demo(System.Windows.Controls.TextBlock outputBlock)
{
Complex[] values = { new Complex(12.4, 6.3),
new Complex(12.4, -6.3) };
foreach (Complex value in values)
{
outputBlock.Text += String.Format("Original value: {0}", value) + "\n";
outputBlock.Text += String.Format("Conjugate: {0}\n",
Complex.Conjugate(value).ToString()) + "\n";
}
}
}
// The example displays the following output:
// Original value: (12.4, 6.3)
// Conjugate: (12.4, -6.3)
//
// Original value: (12.4, -6.3)
// Conjugate: (12.4, 6.3)
Version Information
Silverlight
Supported in: 5, 4
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.