• 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 VectorNd

Multidimensional vector.

Inheritance
System.Object
VectorNd
Implements
IEquatable<VectorNd>
Namespace: Paramdigma.Core.Geometry
Assembly: Paramdigma.Core.dll
Syntax
public class VectorNd : IEnumerable<double>, IEquatable<VectorNd>

Constructors

| Improve this Doc View Source

VectorNd(List<Double>)

Initializes a new instance of the VectorNd class from a given list of coordinates.

Declaration
public VectorNd(List<double> values)
Parameters
Type Name Description
List<System.Double> values

List of values for the vector.

| Improve this Doc View Source

VectorNd(VectorNd)

Initializes a new instance of the VectorNd class.

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

Vector to copy.

| Improve this Doc View Source

VectorNd(Double[])

Initializes a new instance of the VectorNd class from a given list of parameters.

Declaration
public VectorNd(params double[] values)
Parameters
Type Name Description
System.Double[] values

Number parameters.

| Improve this Doc View Source

VectorNd(Int32)

Initializes a new instance of the VectorNd class. Constructs a zero vector of a given dimension.

Declaration
public VectorNd(int dimension)
Parameters
Type Name Description
System.Int32 dimension

Dimension.

Properties

| Improve this Doc View Source

Dimension

Gets the current dimension of the vector.

Declaration
public int Dimension { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Item[Int32]

Gets or sets the coordinate at the given dimension.

Declaration
public double this[int dimension] { get; set; }
Parameters
Type Name Description
System.Int32 dimension
Property Value
Type Description
System.Double

The value of the specified dimension.

| 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

Length2

Gets the squared length of the vector.

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

Methods

| Improve this Doc View Source

Add(VectorNd, VectorNd)

Adds two N dimensional vectors.

Declaration
public static VectorNd Add(VectorNd a, VectorNd b)
Parameters
Type Name Description
VectorNd a

Vector A.

VectorNd b

Vector B.

Returns
Type Description
VectorNd

Vector addition result.

| Improve this Doc View Source

AngularDistance(VectorNd, VectorNd)

Computes the angular distance between two vectors.

Declaration
public static double AngularDistance(VectorNd a, VectorNd b)
Parameters
Type Name Description
VectorNd a

Vector A.

VectorNd b

Vector B.

Returns
Type Description
System.Double

Angular distance value.

| Improve this Doc View Source

AngularSimilarity(VectorNd, VectorNd)

Angular similarity value between two vectors.

Declaration
public static double AngularSimilarity(VectorNd a, VectorNd b)
Parameters
Type Name Description
VectorNd a

Vector A.

VectorNd b

Vector B.

Returns
Type Description
System.Double

Angular similarity value.

| Improve this Doc View Source

CosineSimilarity(VectorNd, VectorNd)

Computes the cosine similarity between two vectors.

Declaration
public static double CosineSimilarity(VectorNd a, VectorNd b)
Parameters
Type Name Description
VectorNd a

Vector A.

VectorNd b

Vector B.

Returns
Type Description
System.Double

Cosine similarity value.

| Improve this Doc View Source

Distance(VectorNd, VectorNd)

Computes the distance between two N-dimensional vectors.

Declaration
public static double Distance(VectorNd a, VectorNd b)
Parameters
Type Name Description
VectorNd a

Vector A.

VectorNd b

Vector B.

Returns
Type Description
System.Double

Distance between vectors.

| Improve this Doc View Source

Distance2(VectorNd, VectorNd)

Computes the square distance between two N-dimensional vectors.

Declaration
public static double Distance2(VectorNd a, VectorNd b)
Parameters
Type Name Description
VectorNd a

Vector A.

VectorNd b

Vector B.

Returns
Type Description
System.Double

Squared distance.

| Improve this Doc View Source

Divide(VectorNd, Double)

Divide an N dimensional vector by a number.

Declaration
public static VectorNd Divide(VectorNd vector, double scalar)
Parameters
Type Name Description
VectorNd vector

Vector to divide.

System.Double scalar

Number to divide by.

Returns
Type Description
VectorNd

Vector division result.

| Improve this Doc View Source

Dot(VectorNd)

Gets the dot product of this vector with another.

Declaration
public double Dot(VectorNd vector)
Parameters
Type Name Description
VectorNd vector

Vector to compute dot product with.

Returns
Type Description
System.Double

Dot product result.

| Improve this Doc View Source

DotProduct(VectorNd, VectorNd)

Computes the dot product between two vectors.

Declaration
public static double DotProduct(VectorNd vectorA, VectorNd vectorB)
Parameters
Type Name Description
VectorNd vectorA

Vector A.

VectorNd vectorB

Vector B.

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

Equals(VectorNd)

Compare this vector with another.

Declaration
public bool Equals(VectorNd vector)
Parameters
Type Name Description
VectorNd vector

Vector to compare with.

Returns
Type Description
System.Boolean

Comparison result.

| Improve this Doc View Source

Equals(Object)

Compare this vector with another object.

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

Object to compare with.

Returns
Type Description
System.Boolean

Comparison result.

| Improve this Doc View Source

GetEnumerator()

Declaration
public IEnumerator<double> GetEnumerator()
Returns
Type Description
IEnumerator<System.Double>
| Improve this Doc View Source

GetHashCode()

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

Multiply(VectorNd, Double)

Multiply an N dimensional vector by a number.

Declaration
public static VectorNd Multiply(VectorNd vector, double scalar)
Parameters
Type Name Description
VectorNd vector

Vector to multiply.

System.Double scalar

Number to multiply by.

Returns
Type Description
VectorNd

Vector multiplication result.

| Improve this Doc View Source

Negate(VectorNd)

Negate a given vector.

Declaration
public static VectorNd Negate(VectorNd vector)
Parameters
Type Name Description
VectorNd vector

Vector to negate.

Returns
Type Description
VectorNd

Vector negation result.

| Improve this Doc View Source

Substract(VectorNd, VectorNd)

Subtract two N dimensional vectors.

Declaration
public static VectorNd Substract(VectorNd a, VectorNd b)
Parameters
Type Name Description
VectorNd a

Vector A.

VectorNd b

Vector B.

Returns
Type Description
VectorNd

Vector substraction result.

| Improve this Doc View Source

ToString()

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

Operators

| Improve this Doc View Source

Addition(VectorNd, VectorNd)

Adds two vectors.

Declaration
public static VectorNd operator +(VectorNd vectorA, VectorNd vectorB)
Parameters
Type Name Description
VectorNd vectorA

Vector A.

VectorNd vectorB

Vector B.

Returns
Type Description
VectorNd

Vector result of the addition.

| Improve this Doc View Source

Division(VectorNd, Double)

Divides a vector by a scalar number.

Declaration
public static VectorNd operator /(VectorNd vector, double scalar)
Parameters
Type Name Description
VectorNd vector

Vector.

System.Double scalar

Scalar.

Returns
Type Description
VectorNd

Vector result of the division.

| Improve this Doc View Source

Multiply(VectorNd, Double)

Multiplies a vector by a scalar number.

Declaration
public static VectorNd operator *(VectorNd vector, double scalar)
Parameters
Type Name Description
VectorNd vector

Vector.

System.Double scalar

Scalar.

Returns
Type Description
VectorNd

Vector result of the multiplication.

| Improve this Doc View Source

Subtraction(VectorNd, VectorNd)

Subtracts one vector from another.

Declaration
public static VectorNd operator -(VectorNd vectorA, VectorNd vectorB)
Parameters
Type Name Description
VectorNd vectorA

Vector A

VectorNd vectorB

Vector B

Returns
Type Description
VectorNd

Vector result of the subtraction.

Implements

IEquatable<>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX