C# Class Voronoi.Algorithms.FortuneHelpers.Vector

A vector class, implementing all interesting features of vectors
Inheritance: IEnumerable, IComparable
ファイルを表示 Open project: TobieD/City-Generator Class Usage Examples

Public Properties

Property Type Description
Precision int
Tag object

Public Methods

Method Description
Add ( Vector V ) : void

Add another vector

Add ( double d ) : void

Add a constant to all elements

Clone ( ) : Vector

Get a copy of one vector

CompareTo ( object obj ) : int

Compare two vectors

Dist ( Vector V1, Vector V2 ) : double

Get the distance of two vectors

Equals ( object obj ) : bool

Compares this vector with another one

GetHashCode ( ) : int

Retrieves a hashcode that is dependent on the elements

Multiply ( double r ) : void

Scale all elements by r

Randomize ( Vector MinMax ) : void

Reset all elements with ransom values from the given range

Randomize ( double Min, double Max ) : void

Reset all elements with ransom values from the given range

ToString ( ) : string

Convert the vector into a reconstructable string representation

Vector ( ) : System

Build a new vector

Vector ( Vector O ) : System

Build a new vector as a copy of an existing one

Vector ( int dim ) : System

Build a new vector

Vector ( string S ) : System

Build a new vector from a string

operator ( ) : Vector

Scale one vector

operator ( ) : double

Get the scalar product of two vectors

this ( int i ) : double

Gets or sets the value of the vector at the given index

Private Methods

Method Description
IEnumerable ( ) : IEnumerator

Method Details

Add() public method

Add another vector
public Add ( Vector V ) : void
V Vector V
return void

Add() public method

Add a constant to all elements
public Add ( double d ) : void
d double The constant
return void

Clone() public method

Get a copy of one vector
public Clone ( ) : Vector
return Vector

CompareTo() public method

Compare two vectors
public CompareTo ( object obj ) : int
obj object
return int

Dist() public static method

Get the distance of two vectors
public static Dist ( Vector V1, Vector V2 ) : double
V1 Vector
V2 Vector
return double

Equals() public method

Compares this vector with another one
public Equals ( object obj ) : bool
obj object
return bool

GetHashCode() public method

Retrieves a hashcode that is dependent on the elements
public GetHashCode ( ) : int
return int

Multiply() public method

Scale all elements by r
public Multiply ( double r ) : void
r double The scalar
return void

Randomize() public method

Reset all elements with ransom values from the given range
public Randomize ( Vector MinMax ) : void
MinMax Vector MinMax[0] - Min /// MinMax[1] - Max
return void

Randomize() public method

Reset all elements with ransom values from the given range
public Randomize ( double Min, double Max ) : void
Min double Min
Max double Max
return void

ToString() public method

Convert the vector into a reconstructable string representation
public ToString ( ) : string
return string

Vector() public method

Build a new vector
public Vector ( ) : System
return System

Vector() public method

Build a new vector as a copy of an existing one
public Vector ( Vector O ) : System
O Vector The existing vector
return System

Vector() public method

Build a new vector
public Vector ( int dim ) : System
dim int The dimension
return System

Vector() public method

Build a new vector from a string
public Vector ( string S ) : System
S string A string, as produced by ToString
return System

operator() public static method

Scale one vector
public static operator ( ) : Vector
return Vector

operator() public static method

Get the scalar product of two vectors
public static operator ( ) : double
return double

this() public method

Gets or sets the value of the vector at the given index
public this ( int i ) : double
i int
return double

Property Details

Precision public_oe static_oe property

Global precision for any calculation
public static int Precision
return int

Tag public_oe property

public object Tag
return object