Show / Hide Table of Contents

Struct Vector

Vector - A value type which defined a vector in terms of X and Y

Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace:ImGui
Assembly:ImGui.dll
Syntax
[Serializable]
public struct Vector : IFormattable

Constructors

| Improve this Doc

Vector(Double, Double)

Constructor which sets the vector's initial values

Declaration
public Vector(double x, double y)
Parameters
Type Name Description
System.Double x

double - The initial X

System.Double y

double - THe initial Y

Fields

| Improve this Doc

Zero

Declaration
public static readonly Vector Zero
Field Value
Type Description
Vector

Properties

| Improve this Doc

Length

Length Property - the length of this Vector

Declaration
public double Length { get; }
Property Value
Type Description
System.Double
| Improve this Doc

LengthSquared

LengthSquared Property - the squared length of this Vector

Declaration
public double LengthSquared { get; }
Property Value
Type Description
System.Double
| Improve this Doc

X

X - double. Default value is 0.

Declaration
public double X { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc

Y

Y - double. Default value is 0.

Declaration
public double Y { get; set; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc

Add(Vector, Point)

Add: Vector + Point

Declaration
public static Point Add(Vector vector, Point point)
Parameters
Type Name Description
Vector vector
Point point
Returns
Type Description
Point
| Improve this Doc

Add(Vector, Vector)

Add: Vector + Vector

Declaration
public static Vector Add(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1
Vector vector2
Returns
Type Description
Vector
| Improve this Doc

AngleBetween(Vector, Vector)

AngleBetween - the angle between 2 vectors

Declaration
public static double AngleBetween(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1

The first Vector

Vector vector2

The second Vector

Returns
Type Description
System.Double

Returns the the angle in degrees between vector1 and vector2

| Improve this Doc

CrossProduct(Vector, Vector)

CrossProduct - Returns the cross product: vector1.Xvector2.Y - vector1.Yvector2.X

Declaration
public static double CrossProduct(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1

The first Vector

Vector vector2

The second Vector

Returns
Type Description
System.Double

Returns the cross product: vector1.Xvector2.Y - vector1.Yvector2.X

| Improve this Doc

Determinant(Vector, Vector)

Determinant - Returns the determinant det(vector1, vector2)

Declaration
public static double Determinant(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1

The first Vector

Vector vector2

The second Vector

Returns
Type Description
System.Double

Returns the determinant: vector1.Xvector2.Y - vector1.Yvector2.X

| Improve this Doc

Divide(Vector, Double)

Multiply: Vector / double

Declaration
public static Vector Divide(Vector vector, double scalar)
Parameters
Type Name Description
Vector vector
System.Double scalar
Returns
Type Description
Vector
| Improve this Doc

Equals(Vector)

Equals - compares this Vector with the passed in object. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.

Declaration
public bool Equals(Vector value)
Parameters
Type Name Description
Vector value

The Vector to compare to "this"

Returns
Type Description
System.Boolean

bool - true if "value" is equal to "this".

| Improve this Doc

Equals(Vector, Vector)

Compares two Vector instances for object equality. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.

Declaration
public static bool Equals(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1

The first Vector to compare

Vector vector2

The second Vector to compare

Returns
Type Description
System.Boolean

bool - true if the two Vector instances are exactly equal, false otherwise

| Improve this Doc

Equals(Object)

Equals - compares this Vector with the passed in object. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
System.Object o

The object to compare to "this"

Returns
Type Description
System.Boolean

bool - true if the object is an instance of Vector and if it's equal to "this".

Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc

GetHashCode()

Returns the HashCode for this Vector

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

int - the HashCode for this Vector

Overrides
System.ValueType.GetHashCode()
| Improve this Doc

Multiply(Vector, Vector)

Multiply - Returns the dot product: vector1.Xvector2.X + vector1.Yvector2.Y

Declaration
public static double Multiply(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1

The first Vector

Vector vector2

The second Vector

Returns
Type Description
System.Double

Returns the dot product: vector1.Xvector2.X + vector1.Yvector2.Y

| Improve this Doc

Multiply(Vector, Double)

Multiply: Vector * double

Declaration
public static Vector Multiply(Vector vector, double scalar)
Parameters
Type Name Description
Vector vector
System.Double scalar
Returns
Type Description
Vector
| Improve this Doc

Multiply(Double, Vector)

Multiply: double * Vector

Declaration
public static Vector Multiply(double scalar, Vector vector)
Parameters
Type Name Description
System.Double scalar
Vector vector
Returns
Type Description
Vector
| Improve this Doc

Negate()

Negates the values of X and Y on this Vector

Declaration
public void Negate()
| Improve this Doc

Normalize()

Normalize - Updates this Vector to maintain its direction, but to have a length of 1. This is equivalent to dividing this Vector by Length

Declaration
public void Normalize()
| Improve this Doc

Parse(String)

Parse - returns an instance converted from the provided string using the culture "en-US"

string with Vector data
Declaration
public static Vector Parse(string source)
Parameters
Type Name Description
System.String source
Returns
Type Description
Vector
| Improve this Doc

Subtract(Vector, Vector)

Subtract: Vector - Vector

Declaration
public static Vector Subtract(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1
Vector vector2
Returns
Type Description
Vector
| Improve this Doc

ToString()

Creates a string representation of this object based on the current culture.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string representation of this object.

Overrides
System.ValueType.ToString()
| Improve this Doc

ToString(IFormatProvider)

Creates a string representation of this object based on the IFormatProvider passed in. If the provider is null, the CurrentCulture is used.

Declaration
public string ToString(IFormatProvider provider)
Parameters
Type Name Description
System.IFormatProvider provider
Returns
Type Description
System.String

A string representation of this object.

Operators

| Improve this Doc

Addition(Vector, Point)

Operator Vector + Point

Declaration
public static Point operator +(Vector vector, Point point)
Parameters
Type Name Description
Vector vector
Point point
Returns
Type Description
Point
| Improve this Doc

Addition(Vector, Vector)

Operator Vector + Vector

Declaration
public static Vector operator +(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1
Vector vector2
Returns
Type Description
Vector
| Improve this Doc

Division(Vector, Double)

Operator Vector / double

Declaration
public static Vector operator /(Vector vector, double scalar)
Parameters
Type Name Description
Vector vector
System.Double scalar
Returns
Type Description
Vector
| Improve this Doc

Equality(Vector, Vector)

Compares two Vector instances for exact equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail. Furthermore, using this equality operator, double.NaN is not equal to itself.

Declaration
public static bool operator ==(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1

The first Vector to compare

Vector vector2

The second Vector to compare

Returns
Type Description
System.Boolean

bool - true if the two Vector instances are exactly equal, false otherwise

| Improve this Doc

Explicit(Vector to Point)

Explicit conversion to Point

Declaration
public static explicit operator Point(Vector vector)
Parameters
Type Name Description
Vector vector

Vector - the Vector to convert to a Point

Returns
Type Description
Point

Point - A Point equal to this Vector

| Improve this Doc

Explicit(Vector to Size)

Explicit conversion to Size. Note that since Size cannot contain negative values, the resulting size will contains the absolute values of X and Y

Declaration
public static explicit operator Size(Vector vector)
Parameters
Type Name Description
Vector vector

Vector - the Vector to convert to a Size

Returns
Type Description
Size

Size - A Size equal to this Vector

| Improve this Doc

Inequality(Vector, Vector)

Compares two Vector instances for exact inequality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail. Furthermore, using this equality operator, double.NaN is not equal to itself.

Declaration
public static bool operator !=(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1

The first Vector to compare

Vector vector2

The second Vector to compare

Returns
Type Description
System.Boolean

bool - true if the two Vector instances are exactly unequal, false otherwise

| Improve this Doc

Multiply(Vector, Vector)

Operator Vector * Vector, interpreted as their dot product

Declaration
public static double operator *(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1
Vector vector2
Returns
Type Description
System.Double
| Improve this Doc

Multiply(Vector, Double)

Operator Vector * double

Declaration
public static Vector operator *(Vector vector, double scalar)
Parameters
Type Name Description
Vector vector
System.Double scalar
Returns
Type Description
Vector
| Improve this Doc

Multiply(Double, Vector)

Operator double * Vector

Declaration
public static Vector operator *(double scalar, Vector vector)
Parameters
Type Name Description
System.Double scalar
Vector vector
Returns
Type Description
Vector
| Improve this Doc

Subtraction(Vector, Vector)

Operator Vector - Vector

Declaration
public static Vector operator -(Vector vector1, Vector vector2)
Parameters
Type Name Description
Vector vector1
Vector vector2
Returns
Type Description
Vector
| Improve this Doc

UnaryNegation(Vector)

Operator -Vector (unary negation)

Declaration
public static Vector operator -(Vector vector)
Parameters
Type Name Description
Vector vector
Returns
Type Description
Vector

Explicit Interface Implementations

| Improve this Doc

IFormattable.ToString(String, IFormatProvider)

Creates a string representation of this object based on the format string and IFormatProvider passed in. If the provider is null, the CurrentCulture is used. See the documentation for IFormattable for more information.

Declaration
string IFormattable.ToString(string format, IFormatProvider provider)
Parameters
Type Name Description
System.String format
System.IFormatProvider provider
Returns
Type Description
System.String

A string representation of this object.

Implements
System.IFormattable.ToString(System.String, System.IFormatProvider)
  • Improve this Doc
Back to top Copyright © 2016 zwcloud
Generated by DocFX