• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Paramdigma.Core
    • Convert
    • Intersect3D
    • Intersect3D.LineLineIntersectionResult
    • Intersect3D.LineLineIntersectionStatus
    • Intersect3D.LinePlaneIntersectionStatus
    • Intersect3D.RayFacePerimeterIntersectionStatus
    • Settings
  • Paramdigma.Core.Collections
    • Interval
    • Matrix<T>
  • Paramdigma.Core.Curves
    • Geodesics
    • LevelSets
  • Paramdigma.Core.Exceptions
    • UnsetGeometryException
  • Paramdigma.Core.Extensions
    • Lists
  • Paramdigma.Core.Geometry
    • BaseCurve
    • BasePoint
    • Box
    • Circle
    • Cylinder
    • Delaunay
    • InvalidCurveException
    • Line
    • Line2d
    • Mesh
    • MeshCorner
    • MeshEdge
    • MeshFace
    • MeshGeometry
    • MeshHalfEdge
    • MeshPoint
    • MeshTopology
    • MeshVertex
    • NurbsCurve
    • NurbsSurface
    • Plane
    • Point2d
    • Point3d
    • Point4d
    • Polyline
    • Polyline2d
    • Ray
    • Ray2d
    • Rectangle2d
    • Sphere
    • Torus
    • Vector2d
    • Vector3d
    • VectorNd
  • Paramdigma.Core.Geometry.Interfaces
    • ICurve
    • ISurface
    • IVector
  • Paramdigma.Core.IO
    • CsvReader
    • CsvWritter
    • OBJMeshData
    • ObjReader
    • ObjWritter
    • OffMeshData
    • OffReader
    • OffResult
    • OffWriter
  • Paramdigma.Core.LinearAlgebra
    • Complex
    • LeastSquaresLinearFit
    • Triplet
    • TripletData
  • Paramdigma.Core.Optimization
    • GradientDescent
    • GradientDescent.FitnessFunction
    • GradientDescentOptions
    • GradientDescentResult
    • KMeansCluster
    • KMeansClustering
    • KMeansClustering.IterationCompletedEventArgs
  • Paramdigma.Core.Spatial
    • DelaunayEdge
    • DelaunayPoint
    • DelaunayTriangle
    • Octree
    • PointCloud
    • PointCloudMember
    • QuadTree

Class Vector2d

Represents a 2-dimensional vector.

Inheritance
System.Object
Vector2d
Namespace: Paramdigma.Core.Geometry
Assembly: Paramdigma.Core.dll
Syntax
public class Vector2d : object

Constructors

| Improve this Doc View Source

Vector2d(Point2d)

Initializes a new instance of the Vector2d class from a point.

Declaration
public Vector2d(Point2d point)
Parameters
Type Name Description
Point2d point

Point to convert.

| Improve this Doc View Source

Vector2d(Vector2d)

Initializes a new instance of the Vector2d class from another vector.

Declaration
public Vector2d(Vector2d vector)
Parameters
Type Name Description
Vector2d vector

Vector to duplicate.

| Improve this Doc View Source

Vector2d(Double, Double)

Initializes a new instance of the Vector2d class.

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

X coordinate.

System.Double y

Y coordinate.

Properties

| Improve this Doc View Source

Length

Gets the length of the vector.

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

LengthSquared

Gets the squared length of the vector.

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

WorldX

Gets a vector in the World X direction {1;0}.

Declaration
public static Vector2d WorldX { get; }
Property Value
Type Description
Vector2d
| Improve this Doc View Source

WorldY

Gets a vector in the World Y direction {0;1}.

Declaration
public static Vector2d WorldY { get; }
Property Value
Type Description
Vector2d
| Improve this Doc View Source

X

Gets or sets the X Coordininate of the vector.

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

X coordinate.

| Improve this Doc View Source

Y

Gets or sets the Y coordinate of the vector.

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

Y coordinate.

Methods

| Improve this Doc View Source

DotProduct(Vector2d)

Computes the dot product between this vector and the given one.

Declaration
public double DotProduct(Vector2d vector)
Parameters
Type Name Description
Vector2d vector

Vector to compute dot-product with.

Returns
Type Description
System.Double

Dot product result.

| Improve this Doc View Source

Equals(Object)

Checks if the vector is equal to an object.

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

Object to compare.

Returns
Type Description
System.Boolean

True if equal.

| Improve this Doc View Source

GetHashCode()

Get the hashCode of the vector.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
| Improve this Doc View Source

Perp()

Returns a CCW perpendicular vector to the current instance.

Declaration
public Vector2d Perp()
Returns
Type Description
Vector2d
| Improve this Doc View Source

PerpProduct(Vector2d)

Computes the perp product between this vector and the given one.

Declaration
public double PerpProduct(Vector2d vector)
Parameters
Type Name Description
Vector2d vector

Vector to compute perp-product with.

Returns
Type Description
System.Double

Perp product result.

| Improve this Doc View Source

ToString()

Gets the string representation of the vector.

Declaration
public override string ToString()
Returns
Type Description
System.String
| Improve this Doc View Source

Unit()

Returns a unit vector of this vector.

Declaration
public Vector2d Unit()
Returns
Type Description
Vector2d

New vector of unit lenght.

| Improve this Doc View Source

Unitize()

Force this vector to be unit length.

Declaration
public void Unitize()

Operators

| Improve this Doc View Source

Addition(Vector2d, Vector2d)

Sums two vectors together.

Declaration
public static Vector2d operator +(Vector2d v, Vector2d v2)
Parameters
Type Name Description
Vector2d v

Vector A.

Vector2d v2

Vector B.

Returns
Type Description
Vector2d
| Improve this Doc View Source

Division(Vector2d, Double)

Divides a vector with a number.

Declaration
public static Vector2d operator /(Vector2d v, double scalar)
Parameters
Type Name Description
Vector2d v

Vector.

System.Double scalar

Number to divide vector with.

Returns
Type Description
Vector2d
| Improve this Doc View Source

Equality(Vector2d, Vector2d)

Checks for equality between two vectors.

Declaration
public static bool operator ==(Vector2d v, Vector2d w)
Parameters
Type Name Description
Vector2d v

Vector A.

Vector2d w

Vector B.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

Inequality(Vector2d, Vector2d)

Checks for inequality between two vectors.

Declaration
public static bool operator !=(Vector2d v, Vector2d w)
Parameters
Type Name Description
Vector2d v

Vector A.

Vector2d w

Vector B.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

Multiply(Vector2d, Double)

Multiplies a vector with a number.

Declaration
public static Vector2d operator *(Vector2d v, double scalar)
Parameters
Type Name Description
Vector2d v

Vector.

System.Double scalar

Number to multiply vector with.

Returns
Type Description
Vector2d
| Improve this Doc View Source

Multiply(Double, Vector2d)

Multiplies a vector with a number.

Declaration
public static Vector2d operator *(double scalar, Vector2d v)
Parameters
Type Name Description
System.Double scalar

Number to multiply vector with.

Vector2d v

Vector.

Returns
Type Description
Vector2d
| Improve this Doc View Source

Subtraction(Vector2d, Vector2d)

Substracts one vector from another.

Declaration
public static Vector2d operator -(Vector2d v, Vector2d v2)
Parameters
Type Name Description
Vector2d v

Vector A.

Vector2d v2

Vector B.

Returns
Type Description
Vector2d
| Improve this Doc View Source

UnaryNegation(Vector2d)

Negates the values of the vector.

Declaration
public static Vector2d operator -(Vector2d v)
Parameters
Type Name Description
Vector2d v

Vector.

Returns
Type Description
Vector2d
  • Improve this Doc
  • View Source
Back to top Generated by DocFX