C# 클래스 OpenBveApi.Math.Vector2

Represents a two-dimensional vector.
파일 보기 프로젝트 열기: leezer3/OpenBVE 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Down Vector2
Left Vector2
Null Vector2
Right Vector2
Up Vector2
X double
Y double

공개 메소드들

메소드 설명
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.

메소드 상세

Dot() 공개 정적인 메소드

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.
리턴 double

IsNullVector() 공개 메소드

Checks whether the vector is a null vector.
public IsNullVector ( ) : bool
리턴 bool

IsNullVector() 공개 정적인 메소드

Checks whether a vector is a null vector.
public static IsNullVector ( Vector2 vector ) : bool
vector Vector2
리턴 bool

IsNullVector() 공개 메소드

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.
리턴 bool

Norm() 공개 메소드

Gets the euclidean norm.
public Norm ( ) : double
리턴 double

Norm() 공개 정적인 메소드

Gets the euclidean norm of the specified vector.
public static Norm ( Vector2 vector ) : double
vector Vector2 The vector.
리턴 double

NormSquared() 공개 메소드

Gets the square of the euclidean norm.
public NormSquared ( ) : double
리턴 double

NormSquared() 공개 정적인 메소드

Gets the square of the euclidean norm of the specified vector.
public static NormSquared ( Vector2 vector ) : double
vector Vector2 The vector.
리턴 double

Normalize() 공개 정적인 메소드

Normalizes a vector.
Raised when the vector is a null vector.
public static Normalize ( Vector2 vector ) : Vector2
vector Vector2 The vector.
리턴 Vector2

Normalize() 공개 메소드

Normalizes the vector.
Raised when the vector is a null vector.
public Normalize ( ) : void
리턴 void

Rotate() 공개 정적인 메소드

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.
리턴 Vector2

Rotate() 공개 메소드

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.
리턴 void

Scale() 공개 정적인 메소드

Scales a vector by a specified factor.
public static Scale ( Vector2 vector, Vector2 factor ) : Vector2
vector Vector2 The vector.
factor Vector2 The factor.
리턴 Vector2

Scale() 공개 메소드

Scales the vector by a specified factor.
public Scale ( Vector2 factor ) : void
factor Vector2 The factor.
리턴 void

ToString() 공개 메소드

Returns the representation of the vector in string format
public ToString ( ) : string
리턴 string

Translate() 공개 정적인 메소드

Translates a vector by a specified offset.
public static Translate ( Vector2 vector, Vector2 offset ) : Vector2
vector Vector2 The vector.
offset Vector2 The offset.
리턴 Vector2

Translate() 공개 메소드

Translates the vector by a specified offset.
public Translate ( Vector2 offset ) : void
offset Vector2 The offset.
리턴 void

Vector2() 공개 메소드

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

operator() 공개 정적인 메소드

Adds two vectors.
public static operator ( ) : Vector2
리턴 Vector2

operator() 공개 정적인 메소드

Checks whether the two specified vectors are equal.
public static operator ( ) : bool
리턴 bool

프로퍼티 상세

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

Represents a vector pointing down.
public static Vector2 Down
리턴 Vector2

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

Represents a vector pointing left.
public static Vector2 Left
리턴 Vector2

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

Represents a null vector.
public static Vector2 Null
리턴 Vector2

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

Represents a vector pointing right.
public static Vector2 Right
리턴 Vector2

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

Represents a vector pointing up.
public static Vector2 Up
리턴 Vector2

X 공개적으로 프로퍼티

The x-coordinate.
public double X
리턴 double

Y 공개적으로 프로퍼티

The y-coordinate.
public double Y
리턴 double