Complex.Real Property
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Gets the real component of the current Complex object.
Namespace: System.Numerics
Assembly: System.Numerics (in System.Numerics.dll)
Syntax
'Declaration
Public ReadOnly Property Real As Double
public double Real { get; }
Property Value
Type: System.Double
The real component of a complex number.
Remarks
Given a complex number a + bi, the Real property returns the value of a.
Examples
The following example instantiates an array of Complex objects and displays the real and imaginary components of each in the form a + bi.
Imports System.Numerics
Module Example
Public Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
Dim values() As Complex = { New Complex(12.5, -6.3),
New Complex(-17.8, 1.7),
New Complex(14.4, 8.9) }
For Each value In values
outputBlock.Text += String.Format("{0} + {1}i", value.Real, value.Imaginary) & vbCrLf
Next
End Sub
End Module
' The example displays the following output:
' 12.5 + -6.3i
' -17.8 + 1.7i
' 14.4 + 8.9i
using System;
using System.Numerics;
public class Example
{
public static void Demo(System.Windows.Controls.TextBlock outputBlock)
{
Complex[] values = { new Complex(12.5, -6.3),
new Complex(-17.8, 1.7),
new Complex(14.4, 8.9) };
foreach (var value in values)
outputBlock.Text += String.Format("{0} + {1}i", value.Real, value.Imaginary) + "\n";
}
}
// The example displays the following output:
// 12.5 + -6.3i
// -17.8 + 1.7i
// 14.4 + 8.9i
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.