Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Microsoft.Geospatial.VectorMath

Brian Kircher edited this page May 9, 2020 · 9 revisions

Vector2D

Describes and manipulates a vector in two-dimensional space using doubles.

public struct Microsoft.Geospatial.VectorMath.Vector2D
    : IEquatable<Vector2D>

Fields

Type Name Summary
Double X Represents the x component of the 2-D vector.
Double Y Represents the y component of the 2-D vector.

Methods

Type Name Summary
Double AbsMaximal() Get the maximal of the absolute values of the elements of this vector
Double AbsMinimal() Get the minimal of the absolute values of the elements of this vector
Vector2D Add(Vector2D right) Adds two vectors together and returns the result.
Int32 CompareTo(Vector2D other) Compare points
Double Dot(Vector2D vec) Get the dot product of the vectors.
Boolean Equals(Vector2D other) Gets whether the parts of two vectors are equivalent.
Boolean Equals(Vector2D& other) Gets whether the parts of two vectors are equivalent.
Boolean Equals(Object obj) Gets whether the parts of two vectors are equivalent.
Int32 GetHashCode() Returns the hash code for this Microsoft.Geospatial.VectorMath.Vector2D.
Double Length() Returns the length of the current 2-D vector.
Double LengthSq() Returns the square of the length of the current 2-D vector.
Vector2D Max(Vector2D vec) Return a new vector that, for each entry, contains the maximal corresponding element of the two vectors
Double Maximal() Get the maximal element of this vector
void Maximize(Vector2D toMaximize) Maximize by the given vector
Vector2D Min(Vector2D vec) Return a new vector that, for each entry, contains the minimal corresponding element of the two vectors
Double Minimal() Get the minimal element of this vector
void Minimize(Vector2D toMinimize) Minimize by the given vector
Vector2D Multiply(Double s) Multiplies a 2-D vector by a value.
void MultiplyBy(Double value) Multiplies a 2-D vector by a value.
Boolean NearlyEquals(Vector2D other, Double epsilon) Compares two Microsoft.Geospatial.VectorMath.Vector2D structures for near equality.
Vector2D Negate() Get a copy of this vector multiplied by -1
void Normalize() Normalizes the current 2-D vector.
Vector2D Subtract(Vector2D right) Subtracts one vector from another.
void Swap(Vector2D& other) Swap the values in this vector with another vector.
String ToString() Returns a string that represents the current object.

Static Fields

Type Name Summary
Vector2D Zero Gets a static readonly vector populated with all zeros.

Static Methods

Type Name Summary
Vector2D Add(Vector2D left, Vector2D right) Adds two vectors together and returns the result.
Double Cross(Vector2D left, Vector2D right) Returns the 2D cross product of two vectors.
Double Cross(Vector2D& left, Vector2D& right) Returns the 2D cross product of two vectors.
Double Distance(Vector2D pointA, Vector2D pointB) Returns the distance between two vectors, assuming that those vectors represent points. Put another way, returns
Double DistanceSq(Vector2D pointA, Vector2D pointB) Returns the square of the distance between two vectors, assuming that those vectors represent points. Put another way, returns
Double DistanceToSegment(Vector2D start, Vector2D end, Vector2D point, Double& percentageBetween) Calculates how far along a line segment a point is.
Double Dot(Vector2D left, Vector2D right) Get the dot product of the vectors.
Double Dot(Vector2D& left, Vector2D& right) Get the dot product of the vectors.
Boolean Equals(Vector2D left, Vector2D right) Gets whether the parts of two vectors are equivalent.
Double GetAngle(Vector2D a, Vector2D b) Calculates the angle in radians between two 2D vectors.
Vector2D GetNormalVector(Vector2D v) Returns a vector normal to this vector.
Double Length(Vector2D vector) Returns the length of the current 2-D vector.
Double LengthSq(Vector2D vector) Returns the square of the length of the current 2-D vector.
Vector2D Lerp(Vector2D a, Vector2D b, Double percent) Linearly interpolate percent (0...1) distance from a to b.
Vector2D Multiply(Vector2D source, Double value) Multiplies a 2-D vector by a value.
Vector2D Multiply(Vector2D vec0, Vector2D vec1) Multiplies a 2-D vector by a value.
Vector2D Normalize(Vector2D vector) Normalizes the current 2-D vector.
Vector2D Parse(String source) Initializes a new instance of the Microsoft.Geospatial.VectorMath.Vector2D struct from a comma-separated string.
Vector2D Subtract(Vector2D left, Vector2D right) Subtracts one vector from another.
Vector2D TransformCoordinate(#=zIEN4oMmw73$NKpb_Rx4gMGOBZflDmVugQA== vector, #=zgSTMDSCkxHjo3$I8nGY6QLpMEgmGS2SxGIMWZ1Y= matrix) Transforms a 2-D vector by a given matrix, projecting the result back into w = 1.
Vector2D TransformCoordinate(#=zIEN4oMmw73$NKpb_Rx4gMGOBZflDmVugQA==& vector, #=zgSTMDSCkxHjo3$I8nGY6QLpMEgmGS2SxGIMWZ1Y=& matrix) Transforms a 2-D vector by a given matrix, projecting the result back into w = 1.
Boolean TryParse(String source, Vector2D& vector) Initializes a new instance of the Microsoft.Geospatial.VectorMath.Vector2D struct from a comma-separated string.

Clone this wiki locally