C# Class StdPaint.Vector2

A vector representing a point in 2D space.
Afficher le fichier Open project: TheBerkin/StdPaint

Méthodes publiques

Свойство Type Description
X double
Y double

Méthodes publiques

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

Returns the distance between two vectors.

DistanceSquared ( Vector2 a, Vector2 b ) : double

Returns the squared distance between two vectors.

Dot ( Vector2 a, Vector2 b ) : double

Returns the dot product of two vectors.

FromPoint ( Point point ) : Vector2

Create a new Vector2 from a Point object.

Normalize ( Vector2 vector ) : Vector2

Returns the normalized version of a vector.

ToPoint ( ) : Point

Create a new Point from the Vector2.

Vector2 ( double x, double y ) : System

Create a new Vector2 from coordinates.

Vector2 ( int x, int y ) : System

Create a new Vector2 from coordinates.

operator ( ) : Vector2

Multiplies two vectors.

Method Details

Distance() public static méthode

Returns the distance between two vectors.
public static Distance ( Vector2 a, Vector2 b ) : double
a Vector2 The first vector.
b Vector2 The second vector.
Résultat double

DistanceSquared() public static méthode

Returns the squared distance between two vectors.
public static DistanceSquared ( Vector2 a, Vector2 b ) : double
a Vector2 The first vector.
b Vector2 The second vector.
Résultat double

Dot() public static méthode

Returns 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

FromPoint() public static méthode

Create a new Vector2 from a Point object.
public static FromPoint ( Point point ) : Vector2
point Point The Point object to create the Vector2 from.
Résultat Vector2

Normalize() public static méthode

Returns the normalized version of a vector.
public static Normalize ( Vector2 vector ) : Vector2
vector Vector2 The vector to normalize.
Résultat Vector2

ToPoint() public méthode

Create a new Point from the Vector2.
public ToPoint ( ) : Point
Résultat Point

Vector2() public méthode

Create a new Vector2 from coordinates.
public Vector2 ( double x, double y ) : System
x double The X coordinate.
y double The Y coordinate.
Résultat System

Vector2() public méthode

Create a new Vector2 from coordinates.
public Vector2 ( int x, int y ) : System
x int The X coordinate.
y int The Y coordinate.
Résultat System

operator() public static méthode

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

Property Details

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