C# Class OpenBveApi.Math.Vector2

Represents a two-dimensional vector.
Afficher le fichier Open project: leezer3/OpenBVE Class Usage Examples

Méthodes publiques

Свойство Type Description
Down Vector2
Left Vector2
Null Vector2
Right Vector2
Up Vector2
X double
Y double

Méthodes publiques

Méthode Description
Dot ( Vector2 a, Vector2 b ) : double

Gives the dot product of two vectors.

IsNullVector ( ) : bool

Checks whether the vector is a null vector.

IsNullVector ( Vector2 vector ) : bool

Checks whether a vector is a null vector.

IsNullVector ( double tolerance ) : bool

Checks whether the vector is considered a null vector.

Norm ( ) : double

Gets the euclidean norm.

Norm ( Vector2 vector ) : double

Gets the euclidean norm of the specified vector.

NormSquared ( ) : double

Gets the square of the euclidean norm.

NormSquared ( Vector2 vector ) : double

Gets the square of the euclidean norm of the specified vector.

Normalize ( Vector2 vector ) : Vector2

Normalizes a vector.

Normalize ( ) : void

Normalizes the vector.

Rotate ( Vector2 vector, double cosineOfAngle, double sineOfAngle ) : Vector2

Rotates a vector by a specified angle.

Rotate ( double cosineOfAngle, double sineOfAngle ) : void

Rotates the vector by the specified angle.

Scale ( Vector2 vector, Vector2 factor ) : Vector2

Scales a vector by a specified factor.

Scale ( Vector2 factor ) : void

Scales the vector by a specified factor.

ToString ( ) : string

Returns the representation of the vector in string format

Translate ( Vector2 vector, Vector2 offset ) : Vector2

Translates a vector by a specified offset.

Translate ( Vector2 offset ) : void

Translates the vector by a specified offset.

Vector2 ( double x, double y ) : System

Creates a new two-dimensional vector.

operator ( ) : Vector2

Adds two vectors.

operator ( ) : bool

Checks whether the two specified vectors are equal.

Method Details

Dot() public static méthode

Gives the dot product of two vectors.
public static Dot ( Vector2 a, Vector2 b ) : double
a Vector2 The first vector.
b Vector2 The second vector.
Résultat double

IsNullVector() public méthode

Checks whether the vector is a null vector.
public IsNullVector ( ) : bool
Résultat bool

IsNullVector() public static méthode

Checks whether a vector is a null vector.
public static IsNullVector ( Vector2 vector ) : bool
vector Vector2
Résultat bool

IsNullVector() public méthode

Checks whether the vector is considered a null vector.
public IsNullVector ( double tolerance ) : bool
tolerance double The highest absolute value that each component of the vector may have before the vector is not considered a null vector.
Résultat bool

Norm() public méthode

Gets the euclidean norm.
public Norm ( ) : double
Résultat double

Norm() public static méthode

Gets the euclidean norm of the specified vector.
public static Norm ( Vector2 vector ) : double
vector Vector2 The vector.
Résultat double

NormSquared() public méthode

Gets the square of the euclidean norm.
public NormSquared ( ) : double
Résultat double

NormSquared() public static méthode

Gets the square of the euclidean norm of the specified vector.
public static NormSquared ( Vector2 vector ) : double
vector Vector2 The vector.
Résultat double

Normalize() public static méthode

Normalizes a vector.
Raised when the vector is a null vector.
public static Normalize ( Vector2 vector ) : Vector2
vector Vector2 The vector.
Résultat Vector2

Normalize() public méthode

Normalizes the vector.
Raised when the vector is a null vector.
public Normalize ( ) : void
Résultat void

Rotate() public static méthode

Rotates a vector by a specified angle.
public static Rotate ( Vector2 vector, double cosineOfAngle, double sineOfAngle ) : Vector2
vector Vector2 The vector.
cosineOfAngle double The cosine of the angle.
sineOfAngle double The sine of the angle.
Résultat Vector2

Rotate() public méthode

Rotates the vector by the specified angle.
public Rotate ( double cosineOfAngle, double sineOfAngle ) : void
cosineOfAngle double The cosine of the angle.
sineOfAngle double The sine of the angle.
Résultat void

Scale() public static méthode

Scales a vector by a specified factor.
public static Scale ( Vector2 vector, Vector2 factor ) : Vector2
vector Vector2 The vector.
factor Vector2 The factor.
Résultat Vector2

Scale() public méthode

Scales the vector by a specified factor.
public Scale ( Vector2 factor ) : void
factor Vector2 The factor.
Résultat void

ToString() public méthode

Returns the representation of the vector in string format
public ToString ( ) : string
Résultat string

Translate() public static méthode

Translates a vector by a specified offset.
public static Translate ( Vector2 vector, Vector2 offset ) : Vector2
vector Vector2 The vector.
offset Vector2 The offset.
Résultat Vector2

Translate() public méthode

Translates the vector by a specified offset.
public Translate ( Vector2 offset ) : void
offset Vector2 The offset.
Résultat void

Vector2() public méthode

Creates a new two-dimensional vector.
public Vector2 ( double x, double y ) : System
x double The x-coordinate.
y double The y-coordinate.
Résultat System

operator() public static méthode

Adds two vectors.
public static operator ( ) : Vector2
Résultat Vector2

operator() public static méthode

Checks whether the two specified vectors are equal.
public static operator ( ) : bool
Résultat bool

Property Details

Down public_oe static_oe property

Represents a vector pointing down.
public static Vector2 Down
Résultat Vector2

Left public_oe static_oe property

Represents a vector pointing left.
public static Vector2 Left
Résultat Vector2

Null public_oe static_oe property

Represents a null vector.
public static Vector2 Null
Résultat Vector2

Right public_oe static_oe property

Represents a vector pointing right.
public static Vector2 Right
Résultat Vector2

Up public_oe static_oe property

Represents a vector pointing up.
public static Vector2 Up
Résultat Vector2

X public_oe property

The x-coordinate.
public double X
Résultat double

Y public_oe property

The y-coordinate.
public double Y
Résultat double