C# 클래스 AForge.Math.Complex

Complex number wrapper class.

The class encapsulates complex number and provides set of different operators to manipulate it, lake adding, subtractio, multiplication, etc.

Sample usage:

// define two complex numbers Complex c1 = new Complex( 3, 9 ); Complex c2 = new Complex( 8, 3 ); // sum Complex s1 = Complex.Add( c1, c2 ); Complex s2 = c1 + c2; Complex s3 = c1 + 5; // difference Complex d1 = Complex.Subtract( c1, c2 ); Complex d2 = c1 - c2; Complex d3 = c1 - 2;
파일 보기 프로젝트 열기: atosorigin/Kinect 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
I Complex
Im double
One Complex
Re double
Zero Complex

공개 메소드들

메소드 설명
Add ( Complex a, Complex b ) : Complex

Adds two complex numbers.

Add ( Complex a, double s ) : Complex

Adds scalar value to a complex number.

Add ( Complex a, Complex b, Complex &result ) : void

Adds two complex numbers and puts the result into the third complex number.

Add ( Complex a, double s, Complex &result ) : void

Adds scalar value to a complex number and puts the result into another complex number.

ApproxEqual ( Complex a, Complex b ) : bool

Tests whether two complex numbers are approximately equal using default tolerance value.

The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.

ApproxEqual ( Complex a, Complex b, double tolerance ) : bool

Tests whether two complex numbers are approximately equal given a tolerance value.

The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.

Clone ( ) : Complex

Creates an exact copy of this Complex object.

Complex ( Complex c ) : System

Initializes a new instance of the Complex class.

Complex ( double re, double im ) : System

Initializes a new instance of the Complex class.

Cos ( Complex a ) : Complex

Calculates Cosine value of the complex number.

Divide ( Complex a, Complex b ) : Complex

Divides one complex number by another complex number.

Divide ( Complex a, double s ) : Complex

Divides a complex number by a scalar value.

Divide ( double s, Complex a ) : Complex

Divides a scalar value by a complex number.

Divide ( Complex a, Complex b, Complex &result ) : void

Divides one complex number by another complex number and puts the result in a third complex number.

Divide ( Complex a, double s, Complex &result ) : void

Divides a complex number by a scalar value and puts the result into another complex number.

Divide ( double s, Complex a, Complex &result ) : void

Divides a scalar value by a complex number and puts the result into another complex number.

Equals ( object obj ) : bool

Returns a value indicating whether this instance is equal to the specified object.

Exp ( Complex a ) : Complex

Calculates exponent (e raised to the specified power) of a complex number.

GetHashCode ( ) : int

Returns the hashcode for this instance.

GetObjectData ( SerializationInfo info, StreamingContext context ) : void

Populates a SerializationInfo with the data needed to serialize the target object.

Log ( Complex a ) : Complex

Calculates natural (base e) logarithm of a complex number.

Multiply ( Complex a, Complex b ) : Complex

Multiplies two complex numbers.

Multiply ( Complex a, double s ) : Complex

Multiplies a complex number by a scalar value.

Multiply ( Complex a, Complex b, Complex &result ) : void

Multiplies two complex numbers and puts the result in a third complex number.

Multiply ( Complex a, double s, Complex &result ) : void

Multiplies a complex number by a scalar value and puts the result into another complex number.

Negate ( Complex a ) : Complex

Negates a complex number.

Parse ( string s ) : Complex

Converts the specified string to its Complex equivalent.

Sin ( Complex a ) : Complex

Calculates Sine value of the complex number.

Sqrt ( Complex a ) : Complex

Calculates square root of a complex number.

Subtract ( Complex a, Complex b ) : Complex

Subtracts one complex number from another.

Subtract ( Complex a, double s ) : Complex

Subtracts a scalar from a complex number.

Subtract ( double s, Complex a ) : Complex

Subtracts a complex number from a scalar value.

Subtract ( Complex a, Complex b, Complex &result ) : void

Subtracts one complex number from another and puts the result in the third complex number.

Subtract ( Complex a, double s, Complex &result ) : void

Subtracts a scalar value from a complex number and puts the result into another complex number.

Subtract ( double s, Complex a, Complex &result ) : void

Subtracts a complex number from a scalar value and puts the result into another complex number.

Tan ( Complex a ) : Complex

Calculates Tangent value of the complex number.

ToString ( ) : string

Returns a string representation of this object.

TryParse ( string s, Complex &result ) : bool

Try to convert the specified string to its Complex equivalent.

operator ( ) : Complex

Negates the complex number.

operator ( ) : bool

Tests whether two specified complex numbers are equal.

비공개 메소드들

메소드 설명
ICloneable ( ) : object

Creates an exact copy of this Complex object.

메소드 상세

Add() 공개 정적인 메소드

Adds two complex numbers.
public static Add ( Complex a, Complex b ) : Complex
a Complex A instance.
b Complex A instance.
리턴 Complex

Add() 공개 정적인 메소드

Adds scalar value to a complex number.
public static Add ( Complex a, double s ) : Complex
a Complex A instance.
s double A scalar value.
리턴 Complex

Add() 공개 정적인 메소드

Adds two complex numbers and puts the result into the third complex number.
public static Add ( Complex a, Complex b, Complex &result ) : void
a Complex A instance.
b Complex A instance.
result Complex A instance to hold the result.
리턴 void

Add() 공개 정적인 메소드

Adds scalar value to a complex number and puts the result into another complex number.
public static Add ( Complex a, double s, Complex &result ) : void
a Complex A instance.
s double A scalar value.
result Complex A instance to hold the result.
리턴 void

ApproxEqual() 공개 정적인 메소드

Tests whether two complex numbers are approximately equal using default tolerance value.

The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.

public static ApproxEqual ( Complex a, Complex b ) : bool
a Complex A instance.
b Complex A instance.
리턴 bool

ApproxEqual() 공개 정적인 메소드

Tests whether two complex numbers are approximately equal given a tolerance value.

The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.

public static ApproxEqual ( Complex a, Complex b, double tolerance ) : bool
a Complex A instance.
b Complex A instance.
tolerance double The tolerance value used to test approximate equality.
리턴 bool

Clone() 공개 메소드

Creates an exact copy of this Complex object.
public Clone ( ) : Complex
리턴 Complex

Complex() 공개 메소드

Initializes a new instance of the Complex class.
public Complex ( Complex c ) : System
c Complex Source complex number.
리턴 System

Complex() 공개 메소드

Initializes a new instance of the Complex class.
public Complex ( double re, double im ) : System
re double Real part.
im double Imaginary part.
리턴 System

Cos() 공개 정적인 메소드

Calculates Cosine value of the complex number.
public static Cos ( Complex a ) : Complex
a Complex A instance.
리턴 Complex

Divide() 공개 정적인 메소드

Divides one complex number by another complex number.
Can not divide by zero.
public static Divide ( Complex a, Complex b ) : Complex
a Complex A instance.
b Complex A instance.
리턴 Complex

Divide() 공개 정적인 메소드

Divides a complex number by a scalar value.
Can not divide by zero.
public static Divide ( Complex a, double s ) : Complex
a Complex A instance.
s double A scalar value.
리턴 Complex

Divide() 공개 정적인 메소드

Divides a scalar value by a complex number.
Can not divide by zero.
public static Divide ( double s, Complex a ) : Complex
s double A scalar value.
a Complex A instance.
리턴 Complex

Divide() 공개 정적인 메소드

Divides one complex number by another complex number and puts the result in a third complex number.
Can not divide by zero.
public static Divide ( Complex a, Complex b, Complex &result ) : void
a Complex A instance.
b Complex A instance.
result Complex A instance to hold the result.
리턴 void

Divide() 공개 정적인 메소드

Divides a complex number by a scalar value and puts the result into another complex number.
Can not divide by zero.
public static Divide ( Complex a, double s, Complex &result ) : void
a Complex A instance.
s double A scalar value.
result Complex A instance to hold the result.
리턴 void

Divide() 공개 정적인 메소드

Divides a scalar value by a complex number and puts the result into another complex number.
Can not divide by zero.
public static Divide ( double s, Complex a, Complex &result ) : void
s double A scalar value.
a Complex A instance.
result Complex A instance to hold the result.
리턴 void

Equals() 공개 메소드

Returns a value indicating whether this instance is equal to the specified object.
public Equals ( object obj ) : bool
obj object An object to compare to this instance.
리턴 bool

Exp() 공개 정적인 메소드

Calculates exponent (e raised to the specified power) of a complex number.
public static Exp ( Complex a ) : Complex
a Complex A instance.
리턴 Complex

GetHashCode() 공개 메소드

Returns the hashcode for this instance.
public GetHashCode ( ) : int
리턴 int

GetObjectData() 공개 메소드

Populates a SerializationInfo with the data needed to serialize the target object.
public GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info System.Runtime.Serialization.SerializationInfo The to populate with data.
context System.Runtime.Serialization.StreamingContext The destination (see ) for this serialization.
리턴 void

Log() 공개 정적인 메소드

Calculates natural (base e) logarithm of a complex number.
public static Log ( Complex a ) : Complex
a Complex A instance.
리턴 Complex

Multiply() 공개 정적인 메소드

Multiplies two complex numbers.
public static Multiply ( Complex a, Complex b ) : Complex
a Complex A instance.
b Complex A instance.
리턴 Complex

Multiply() 공개 정적인 메소드

Multiplies a complex number by a scalar value.
public static Multiply ( Complex a, double s ) : Complex
a Complex A instance.
s double A scalar value.
리턴 Complex

Multiply() 공개 정적인 메소드

Multiplies two complex numbers and puts the result in a third complex number.
public static Multiply ( Complex a, Complex b, Complex &result ) : void
a Complex A instance.
b Complex A instance.
result Complex A instance to hold the result.
리턴 void

Multiply() 공개 정적인 메소드

Multiplies a complex number by a scalar value and puts the result into another complex number.
public static Multiply ( Complex a, double s, Complex &result ) : void
a Complex A instance.
s double A scalar value.
result Complex A instance to hold the result.
리턴 void

Negate() 공개 정적인 메소드

Negates a complex number.
public static Negate ( Complex a ) : Complex
a Complex A instance.
리턴 Complex

Parse() 공개 정적인 메소드

Converts the specified string to its Complex equivalent.
String representation of the complex number is not correctly formatted.
public static Parse ( string s ) : Complex
s string A string representation of a complex number.
리턴 Complex

Sin() 공개 정적인 메소드

Calculates Sine value of the complex number.
public static Sin ( Complex a ) : Complex
a Complex A instance.
리턴 Complex

Sqrt() 공개 정적인 메소드

Calculates square root of a complex number.
public static Sqrt ( Complex a ) : Complex
a Complex A instance.
리턴 Complex

Subtract() 공개 정적인 메소드

Subtracts one complex number from another.
public static Subtract ( Complex a, Complex b ) : Complex
a Complex A instance to subtract from.
b Complex A instance to be subtracted.
리턴 Complex

Subtract() 공개 정적인 메소드

Subtracts a scalar from a complex number.
public static Subtract ( Complex a, double s ) : Complex
a Complex A instance to subtract from.
s double A scalar value to be subtracted.
리턴 Complex

Subtract() 공개 정적인 메소드

Subtracts a complex number from a scalar value.
public static Subtract ( double s, Complex a ) : Complex
s double A scalar value to subtract from.
a Complex A instance to be subtracted.
리턴 Complex

Subtract() 공개 정적인 메소드

Subtracts one complex number from another and puts the result in the third complex number.
public static Subtract ( Complex a, Complex b, Complex &result ) : void
a Complex A instance to subtract from.
b Complex A instance to be subtracted.
result Complex A instance to hold the result.
리턴 void

Subtract() 공개 정적인 메소드

Subtracts a scalar value from a complex number and puts the result into another complex number.
public static Subtract ( Complex a, double s, Complex &result ) : void
a Complex A instance to subtract from.
s double A scalar value to be subtracted.
result Complex A instance to hold the result.
리턴 void

Subtract() 공개 정적인 메소드

Subtracts a complex number from a scalar value and puts the result into another complex number.
public static Subtract ( double s, Complex a, Complex &result ) : void
s double A scalar value to subtract from.
a Complex A instance to be subtracted.
result Complex A instance to hold the result.
리턴 void

Tan() 공개 정적인 메소드

Calculates Tangent value of the complex number.
public static Tan ( Complex a ) : Complex
a Complex A instance.
리턴 Complex

ToString() 공개 메소드

Returns a string representation of this object.
public ToString ( ) : string
리턴 string

TryParse() 공개 정적인 메소드

Try to convert the specified string to its Complex equivalent.
public static TryParse ( string s, Complex &result ) : bool
s string A string representation of a complex number.
result Complex instance to output the result to.
리턴 bool

operator() 공개 정적인 메소드

Negates the complex number.
public static operator ( ) : Complex
리턴 Complex

operator() 공개 정적인 메소드

Tests whether two specified complex numbers are equal.
public static operator ( ) : bool
리턴 bool

프로퍼티 상세

I 공개적으로 정적으로 프로퍼티

A double-precision complex number that represents the squere root of (-1).
public static Complex I
리턴 Complex

Im 공개적으로 프로퍼티

Imaginary part of the complex number.
public double Im
리턴 double

One 공개적으로 정적으로 프로퍼티

A double-precision complex number that represents one.
public static Complex One
리턴 Complex

Re 공개적으로 프로퍼티

Real part of the complex number.
public double Re
리턴 double

Zero 공개적으로 정적으로 프로퍼티

A double-precision complex number that represents zero.
public static Complex Zero
리턴 Complex