BRIDGES
  • Articles
  • BRIDGES
Search Results for

    Show / Hide Table of Contents
    • Settings
    • LinearAlgebra
      • Vectors
        • DenseVector
        • SparseVector
        • Vector
      • Factorisation
        • SparseQR
      • Matrices
        • DenseMatrix
        • Matrix
        • SparseMatrix
        • Sparse
          • CompressedColumn
          • CompressedRow
        • Storage
          • DictionaryOfKeys
    • Algebra
      • Measure
        • IDotProduct<TSelf, TValue>
        • IMetric<TSelf>
        • INorm<TSelf>
      • Sets
        • IGroupAction<TSelf, TValue>
      • Fundamentals
        • IAddable<T>
    • Solvers
      • GuidedProjection
        • Energy
        • GuidedProjectionAlgorithm
        • LinearisedConstraint
        • QuadraticConstraint
        • VariableSet
        • EnergyTypes
          • SegmentOrthogonality
          • SegmentParallelity
        • Interfaces
          • IEnergyType
          • ILinearisedConstraintType
          • IQuadraticConstraintType
        • QuadraticConstraintTypes
          • CoherentLength
          • LowerBound
          • UpperBound
          • VectorLength
    • Arithmetic
      • Polynomials
        • Multivariate
          • Monomial
          • Polynomial
        • Univariate
          • Polynomial
          • Specials
            • Bernstein
            • BSpline
      • Numbers
        • Complex
        • Quaternion
        • Real
    • Geometry
      • Euclidean3D
        • Basis
        • BSplineCurve
        • BSplineSurface
        • Circle
        • Frame
        • Line
        • NurbsCurve
        • NurbsSurface
        • Plane
        • Point
        • Polyline
        • Ray
        • Segment
        • Sphere
        • Vector
      • Kernel
        • BSplineCurve<TPoint>
        • BSplineSurface<TPoint>
        • CurveParameterFormat
        • IGeometricallyEquatable<T>
      • Projective3D
        • Point
    • DataStructures
      • PolyhedralMeshes
        • IEdge<TPosition>
        • IFace<TPosition>
        • IMesh<TPosition>
        • IVertex<TPosition>
        • FaceVertexMesh
          • Edge<TPosition>
          • Face<TPosition>
          • Mesh<TPosition>
          • Vertex<TPosition>
        • Abstract
          • Edge<TPosition, TVertex, TEdge, TFace>
          • Face<TPosition, TVertex, TEdge, TFace>
          • Mesh<TPosition, TVertex, TEdge, TFace>
          • Vertex<TPosition, TVertex, TEdge, TFace>
        • HalfedgeMesh
          • Edge<TPosition>
          • Face<TPosition>
          • Halfedge<TPosition>
          • Mesh<TPosition>
          • Vertex<TPosition>

    Struct Vector

    Structure defining a vector in three-dimensional euclidean space.

    Implements
    IEquatable<Vector>
    IDotProduct<Vector, Double>
    INorm<Vector>
    IMetric<Vector>
    IGroupAction<Vector, Double>
    Namespace: BRIDGES.Geometry.Euclidean3D
    Assembly: BRIDGES.dll
    Syntax
    public struct Vector : IDotProduct<Vector, double>, INorm<Vector>, IMetric<Vector>, IGroupAction<Vector, double>

    Constructors

    | Improve this Doc View Source

    Vector(Point, Point)

    Initialises a new instance of Vector structure from two Point.

    Declaration
    public Vector(Point start, Point end)
    Parameters
    Type Name Description
    Point start

    Point at start.

    Point end

    Point at end.

    | Improve this Doc View Source

    Vector(Vector)

    Initialises a new instance of the Vector structure from another Vector.

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

    Vector to deep copy.

    | Improve this Doc View Source

    Vector(Double, Double, Double)

    Initialises a new instance of the Vector structure by defining its three coordinates.

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

    Value of the first coordinate.

    Double y

    Value of the second coordinate.

    Double z

    Value of the third coordinate.

    | Improve this Doc View Source

    Vector(Double[])

    Initialises a new instance of Vector structure by defining its coordinates.

    Declaration
    public Vector(double[] coordinates)
    Parameters
    Type Name Description
    Double[] coordinates

    Value of the coordinates.

    Properties

    | Improve this Doc View Source

    Dimension

    Gets the dimension of this Vector's euclidean space.

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

    Item[Int32]

    Gets or sets the value of the coordinate at the given index.

    Declaration
    public double this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index

    Index of the coordinate to get or set.

    Property Value
    Type Description
    Double

    The value of the coordinate at the given index.

    | Improve this Doc View Source

    WorldX

    Gets a new Vector with coordinates (1.0, 0.0, 0.0).

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

    WorldY

    Gets a new Vector with coordinates (0.0, 1.0, 0.0).

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

    WorldZ

    Gets a new Vector with coordinates (0.0, 0.0, 1.0).

    Declaration
    public static readonly Vector WorldZ { get; }
    Property Value
    Type Description
    Vector
    | Improve this Doc View Source

    X

    Gets or sets the first coordinate of this Vector.

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

    Y

    Gets or sets the second coordinate of this Vector.

    Declaration
    public double Y { get; set; }
    Property Value
    Type Description
    Double
    | Improve this Doc View Source

    Z

    Gets or sets the third coordinate of this Vector.

    Declaration
    public double Z { get; set; }
    Property Value
    Type Description
    Double
    | Improve this Doc View Source

    Zero

    Gets a new Vector with coordinates (0.0, 0.0, 0.0).

    Declaration
    public static readonly Vector Zero { get; }
    Property Value
    Type Description
    Vector

    Methods

    | Improve this Doc View Source

    Add(Point, Vector)

    Computes left the addition of a Vector with a Point.

    Declaration
    public static Vector Add(Point left, Vector right)
    Parameters
    Type Name Description
    Point left

    Point for the addition.

    Vector right

    Vector for the addition.

    Returns
    Type Description
    Vector

    The new Vector resulting from the addition.

    | Improve this Doc View Source

    Add(Vector, Point)

    Computes right the addition of a Vector with a Point.

    Declaration
    public static Vector Add(Vector left, Point right)
    Parameters
    Type Name Description
    Vector left

    Vector for the addition.

    Point right

    Point for the addition.

    Returns
    Type Description
    Vector

    The new Vector resulting from the addition.

    | Improve this Doc View Source

    Add(Vector, Vector)

    Computes the addition of two Vector.

    Declaration
    public static Vector Add(Vector left, Vector right)
    Parameters
    Type Name Description
    Vector left

    Vector for the addition.

    Vector right

    Vector for the addition.

    Returns
    Type Description
    Vector

    The new Vector resulting from the addition.

    | Improve this Doc View Source

    AngleBetween(Vector, Vector)

    Computes the angle between two Vector.

    Declaration
    public static double AngleBetween(Vector vectorA, Vector vectorB)
    Parameters
    Type Name Description
    Vector vectorA

    Vector for the angle evaluation.

    Vector vectorB

    Vector for the angle evaluation.

    Returns
    Type Description
    Double

    The value of the angle between the two Vector (in radians).

    | Improve this Doc View Source

    AngleWith(Vector)

    Computes the angle made by this Vector with another Vector.

    Declaration
    public double AngleWith(Vector other)
    Parameters
    Type Name Description
    Vector other

    Vector to compare with.

    Returns
    Type Description
    Double

    The value of the angle (in radians).

    | Improve this Doc View Source

    AreOrthogonal(Vector, Vector)

    Evaluates whether two Vector are orthogonal.

    Declaration
    public static bool AreOrthogonal(Vector vectorA, Vector vectorB)
    Parameters
    Type Name Description
    Vector vectorA

    Vector for the comparison.

    Vector vectorB

    Vector for the comparison.

    Returns
    Type Description
    Boolean

    true if the two Vector are orthogonal, false otherwise.

    | Improve this Doc View Source

    AreOrthogonal(Vector[])

    Evaluates whether a collection of Vector are orthogonal to one another.

    Declaration
    public static bool AreOrthogonal(params Vector[] vectors)
    Parameters
    Type Name Description
    Vector[] vectors

    Collection of Vector to evaluate.

    Returns
    Type Description
    Boolean

    true if the Vector are orthogonal, false otherwise.

    | Improve this Doc View Source

    AreParallel(Vector, Vector)

    Evaluates whether two Vector are parallel.

    Declaration
    public static bool AreParallel(Vector vectorA, Vector vectorB)
    Parameters
    Type Name Description
    Vector vectorA

    Vector for the comparison.

    Vector vectorB

    Vector for the comparison.

    Returns
    Type Description
    Boolean

    true if the two Vector are parallel, false otherwise.

    | Improve this Doc View Source

    CrossProduct(Vector, Vector)

    Returns the cross product of two Vector.

    Declaration
    public static Vector CrossProduct(Vector left, Vector right)
    Parameters
    Type Name Description
    Vector left

    Left Vector for the cross product.

    Vector right

    Right Vector for the cross product.

    Returns
    Type Description
    Vector

    A new Vector resulting from the cross product of two Vector.

    | Improve this Doc View Source

    Divide(Vector, Double)

    Computes the scalar division of a Vector with a -precision real number.

    Declaration
    public static Vector Divide(Vector operand, double divisor)
    Parameters
    Type Name Description
    Vector operand

    Vector to divide.

    Double divisor

    -precision real number to divide with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the scalar division.

    | Improve this Doc View Source

    DotProduct(Vector, Vector)

    Computes the dot product of two Vector.

    Declaration
    public static double DotProduct(Vector left, Vector right)
    Parameters
    Type Name Description
    Vector left

    Vector for the dot product.

    Vector right

    Vector for the dot product.

    Returns
    Type Description
    Double

    The new Vector resulting from the dot product of two Vector.

    | Improve this Doc View Source

    Equals(Vector)

    Evaluates whether this Vector is memberwise equal to another Vector.

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

    Vector to compare with.

    Returns
    Type Description
    Boolean

    true if the two Vector are equal, false otherwise.

    Remarks

    Two Vector are equal if their coordinates are equal.

    | Improve this Doc View Source

    Equals(Object)

    Structure defining a vector in three-dimensional euclidean space.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    GetCoordinates()

    Gets the coordinates of this Vector.

    Declaration
    public double[] GetCoordinates()
    Returns
    Type Description
    Double[]

    The array representation of the Vector's coordinates.

    | Improve this Doc View Source

    GetHashCode()

    Structure defining a vector in three-dimensional euclidean space.

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

    IsUnit()

    Evaluates whether this Vector's length is one.

    Declaration
    public bool IsUnit()
    Returns
    Type Description
    Boolean

    true if this Vector is of unit length, false otherwise.

    | Improve this Doc View Source

    Length()

    Computes the length of this Vector (using the L2-norm).

    Declaration
    public double Length()
    Returns
    Type Description
    Double

    The value of this Vector's length.

    | Improve this Doc View Source

    Multiply(Vector, Double)

    Computes the right scalar multiplication of a Vector with a number.

    Declaration
    public static Vector Multiply(Vector operand, double factor)
    Parameters
    Type Name Description
    Vector operand

    Vector to multiply.

    Double factor

    number.

    Returns
    Type Description
    Vector

    The new Vector resulting from the scalar multiplication.

    | Improve this Doc View Source

    Multiply(Double, Vector)

    Computes the left scalar multiplication of a Vector with a number.

    Declaration
    public static Vector Multiply(double factor, Vector operand)
    Parameters
    Type Name Description
    Double factor

    number.

    Vector operand

    Vector to multiply.

    Returns
    Type Description
    Vector

    The new Vector resulting from the scalar multiplication.

    | Improve this Doc View Source

    SquaredLength()

    Computes the squared length of this Vector (using the L2-norm).

    Declaration
    public double SquaredLength()
    Returns
    Type Description
    Double

    The value of this Vector's squared length.

    | Improve this Doc View Source

    Subtract(Point, Vector)

    Computes left the subtraction of a Vector with a Point.

    Declaration
    public static Vector Subtract(Point left, Vector right)
    Parameters
    Type Name Description
    Point left

    Point to subtract.

    Vector right

    Vector to subtract with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the subtraction.

    | Improve this Doc View Source

    Subtract(Vector, Point)

    Computes right the subtraction of a Vector with a Point.

    Declaration
    public static Vector Subtract(Vector left, Point right)
    Parameters
    Type Name Description
    Vector left

    Vector to subtract.

    Point right

    Point to subtract with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the subtraction.

    | Improve this Doc View Source

    Subtract(Vector, Vector)

    Computes the subtraction of two Vector.

    Declaration
    public static Vector Subtract(Vector left, Vector right)
    Parameters
    Type Name Description
    Vector left

    Vector to subtract.

    Vector right

    Vector to subtract with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the subtraction.

    | Improve this Doc View Source

    ToString()

    Structure defining a vector in three-dimensional euclidean space.

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

    Unitise()

    Unitises this Vector (using the L2-norm).

    Declaration
    public void Unitise()

    Operators

    | Improve this Doc View Source

    Addition(Vector, Point)

    Computes right the addition of a Vector with a Point.

    Declaration
    public static Vector operator +(Vector left, Point right)
    Parameters
    Type Name Description
    Vector left

    Vector for the addition.

    Point right

    Point for the addition.

    Returns
    Type Description
    Vector

    The new Vector resulting from the addition.

    | Improve this Doc View Source

    Addition(Vector, Vector)

    Computes the addition of two Vector.

    Declaration
    public static Vector operator +(Vector left, Vector right)
    Parameters
    Type Name Description
    Vector left

    Vector for the addition.

    Vector right

    Vector for the addition.

    Returns
    Type Description
    Vector

    The new Vector resulting from the addition.

    | Improve this Doc View Source

    Division(Vector, Double)

    Computes the scalar division of a Vector with a -precision real number.

    Declaration
    public static Vector operator /(Vector operand, double divisor)
    Parameters
    Type Name Description
    Vector operand

    Vector to divide.

    Double divisor

    -precision real number to divide with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the scalar division.

    | Improve this Doc View Source

    Implicit(Point to Vector)

    Converts a Point into a Vector.

    Declaration
    public static implicit operator Vector(Point point)
    Parameters
    Type Name Description
    Point point

    Point to convert.

    Returns
    Type Description
    Vector

    The new Vector resulting from the conversion.

    | Improve this Doc View Source

    Multiply(Vector, Vector)

    Computes the dot product of two Vector.

    Declaration
    public static double operator *(Vector left, Vector right)
    Parameters
    Type Name Description
    Vector left

    Vector for the dot product.

    Vector right

    Vector for the dot product.

    Returns
    Type Description
    Double

    The new Vector resulting from the dot product of two Vector.

    | Improve this Doc View Source

    Multiply(Vector, Double)

    Computes the right scalar multiplication of a Vector with a number.

    Declaration
    public static Vector operator *(Vector operand, double factor)
    Parameters
    Type Name Description
    Vector operand

    Vector to multiply.

    Double factor

    number.

    Returns
    Type Description
    Vector

    The new Vector resulting from the scalar multiplication.

    | Improve this Doc View Source

    Multiply(Double, Vector)

    Computes the left scalar multiplication of a Vector with a number.

    Declaration
    public static Vector operator *(double factor, Vector operand)
    Parameters
    Type Name Description
    Double factor

    number.

    Vector operand

    Vector to multiply.

    Returns
    Type Description
    Vector

    The new Vector resulting from the scalar multiplication.

    | Improve this Doc View Source

    Subtraction(Vector, Point)

    Computes right the subtraction of a Vector with a Point.

    Declaration
    public static Vector operator -(Vector left, Point right)
    Parameters
    Type Name Description
    Vector left

    Vector to subtract.

    Point right

    Point to subtract with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the subtraction.

    | Improve this Doc View Source

    Subtraction(Vector, Vector)

    Computes the subtraction of two Vector.

    Declaration
    public static Vector operator -(Vector left, Vector right)
    Parameters
    Type Name Description
    Vector left

    Vector to subtract.

    Vector right

    Vector to subtract with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the subtraction.

    | Improve this Doc View Source

    UnaryNegation(Vector)

    Computes the opposite of the given Vector.

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

    Vector to be opposed.

    Returns
    Type Description
    Vector

    The new Vector, opposite of the initial one.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IDotProduct<Vector, Double>.DotProduct(Vector)

    Computes the dot product of this element with another element.

    Declaration
    double IDotProduct<Vector, double>.DotProduct(Vector other)
    Parameters
    Type Name Description
    Vector other
    Returns
    Type Description
    Double

    The value of the dot product of the two elements.

    | Improve this Doc View Source

    IMetric<Vector>.DistanceTo(Vector)

    Computes the distance of this element to another element.

    Declaration
    double IMetric<Vector>.DistanceTo(Vector other)
    Parameters
    Type Name Description
    Vector other
    Returns
    Type Description
    Double

    The value of the distance between the two elements.

    | Improve this Doc View Source

    INorm<Vector>.Norm()

    Computes the norm of this element.

    Declaration
    double INorm<Vector>.Norm()
    Returns
    Type Description
    Double

    The value of the norm.

    | Improve this Doc View Source

    IGroupAction<Vector, Double>.Divide(Double)

    Computes the right scalar division of the current element.

    Declaration
    Vector IGroupAction<Vector, double>.Divide(double divisor)
    Parameters
    Type Name Description
    Double divisor
    Returns
    Type Description
    Vector

    The new element resulting from the scalar dividion.

    | Improve this Doc View Source

    IGroupAction<Vector, Double>.Multiply(Double)

    Computes the right scalar multiplication of the current element.

    Declaration
    Vector IGroupAction<Vector, double>.Multiply(double factor)
    Parameters
    Type Name Description
    Double factor
    Returns
    Type Description
    Vector

    The new element resulting from the scalar multiplication.

    Implements

    IEquatable<>
    IDotProduct<TSelf, TValue>
    INorm<TSelf>
    IMetric<TSelf>
    IGroupAction<TSelf, TValue>
    • Improve this Doc
    • View Source
    In This Article
    Back to top By ENPC and the Build'In Platform