C# Класс Axiom.Math.Vector2

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
x Real

Открытые методы

Метод Описание
Add ( Vector2 left, Vector2 right ) : Vector2

Used when a Vector2 is added to another Vector2.

Cross ( Vector2 vector ) : Real

Calculates the 2 dimensional cross-product of 2 vectors, which results in a Real value which is 2 times the area of the triangle defined by the two vectors. It also is the magnitude of the 3D vector that is perpendicular to the 2D vectors if the 2D vectors are projected to 3D space.

Dot ( Vector2 vector ) : Real

Calculates the 2 dimensional dot-product of 2 vectors, which is equal to the cosine of the angle between the vectors, times the lengths of each of the vectors. A.Dot(B) == |A| * |B| * cos(fi)

Equals ( object obj ) : bool
GetHashCode ( ) : int
Multiply ( Real scalar, Vector2 right ) : Vector2

Used when a scalar value is multiplied by a Vector2.

Multiply ( Vector2 left, Real scalar ) : Vector2

Used when a Vector2 is multiplied by a scalar value.

Negate ( Vector2 left ) : Vector2

Used to negate the elements of a vector.

Normalize ( ) : Real

Normalizes the vector.

This method normalises the vector such that it's length / magnitude is 1. The result is called a unit vector.

This function will not crash for zero-sized vectors, but there will be no changes made to their components.

Parse ( string s ) : Vector2
Subtract ( Vector2 left, Vector2 right ) : Vector2

Used to subtract a Vector2 from another Vector2.

ToNormalized ( ) : Vector2

Gets a normalized (unit length) vector of this vector

ToString ( ) : string
Vector2 ( Real x, Real y ) : System

Constructor.

operator ( ) : Vector2

Used when a Vector2 is added to another Vector2.

operator ( ) : bool

Описание методов

Add() публичный статический метод

Used when a Vector2 is added to another Vector2.
public static Add ( Vector2 left, Vector2 right ) : Vector2
left Vector2
right Vector2
Результат Vector2

Cross() публичный метод

Calculates the 2 dimensional cross-product of 2 vectors, which results in a Real value which is 2 times the area of the triangle defined by the two vectors. It also is the magnitude of the 3D vector that is perpendicular to the 2D vectors if the 2D vectors are projected to 3D space.
public Cross ( Vector2 vector ) : Real
vector Vector2
Результат Real

Dot() публичный метод

Calculates the 2 dimensional dot-product of 2 vectors, which is equal to the cosine of the angle between the vectors, times the lengths of each of the vectors. A.Dot(B) == |A| * |B| * cos(fi)
public Dot ( Vector2 vector ) : Real
vector Vector2
Результат Real

Equals() публичный метод

public Equals ( object obj ) : bool
obj object
Результат bool

GetHashCode() публичный метод

public GetHashCode ( ) : int
Результат int

Multiply() публичный статический метод

Used when a scalar value is multiplied by a Vector2.
public static Multiply ( Real scalar, Vector2 right ) : Vector2
scalar Real
right Vector2
Результат Vector2

Multiply() публичный статический метод

Used when a Vector2 is multiplied by a scalar value.
public static Multiply ( Vector2 left, Real scalar ) : Vector2
left Vector2
scalar Real
Результат Vector2

Negate() публичный статический метод

Used to negate the elements of a vector.
public static Negate ( Vector2 left ) : Vector2
left Vector2
Результат Vector2

Normalize() публичный метод

Normalizes the vector.
This method normalises the vector such that it's length / magnitude is 1. The result is called a unit vector.

This function will not crash for zero-sized vectors, but there will be no changes made to their components.

public Normalize ( ) : Real
Результат Real

Parse() публичный метод

public Parse ( string s ) : Vector2
s string
Результат Vector2

Subtract() публичный статический метод

Used to subtract a Vector2 from another Vector2.
public static Subtract ( Vector2 left, Vector2 right ) : Vector2
left Vector2
right Vector2
Результат Vector2

ToNormalized() публичный метод

Gets a normalized (unit length) vector of this vector
public ToNormalized ( ) : Vector2
Результат Vector2

ToString() публичный метод

public ToString ( ) : string
Результат string

Vector2() публичный метод

Constructor.
public Vector2 ( Real x, Real y ) : System
x Real X position.
y Real Y position
Результат System

operator() публичный статический метод

Used when a Vector2 is added to another Vector2.
public static operator ( ) : Vector2
Результат Vector2

operator() публичный статический метод

public static operator ( ) : bool
Результат bool

Описание свойств

x публичное свойство

public Real x
Результат Real