# Vector

public struct Vector : Equatable

Vector object

In the Euclidean geometry, a vector is what is needed to “carry” the point A to the point B; it is a geometric object that has magnitude (or length) and direction. Vectors can be added to other vectors according to vector algebra. A Euclidean vector is frequently represented by a line segment with a definite direction, or graphically as an arrow, connecting an initial point A with a terminal point B, and denoted by \overrightarrow{AB}.

•  x 

X-coordinate of the vector

#### Declaration

Swift

public var x: BigDouble
•  y 

Y-coordinate of the vector

#### Declaration

Swift

public var y: BigDouble
•  dims 

X, Y and higher dimensions

#### Declaration

Swift

public var dims: [BigDouble]
•  origin 

Origin of the vector

#### Declaration

Swift

public var origin: Point
•  init(x:y:origin:) 

Simple 2D Vector

#### Declaration

Swift

public init(x: BigDouble, y: BigDouble, origin: Point = Point(x: 0, y: 0))

#### Parameters

  x  X coordinate  y  Y coordinate
•  init(x:origin:) 

Simple 1D Vector

#### Declaration

Swift

public init(x: BigDouble, origin: Point = Point(x: 0))

#### Parameters

  x  X coordinate
•  init(multipleDimensions:origin:) 

Vector in more than 2 dimensions

#### Declaration

Swift

public init(multipleDimensions: [BigDouble], origin: Point? = nil)

#### Parameters

  multipleDimensions  An containing the coordinates: [x, y, z, ...]
•  matrix 

Converts a Vector into a Matrix

#### Declaration

Swift

public var matrix: Matrix { get }
•  translated 

Origin point translated by the vector

#### Declaration

Swift

public var translated: Point { get }
•  +(_:_:) 

Sum of two vectors

#### Declaration

Swift

public static func + (rhs: Vector, lhs: Vector) -> Vector
•  *(_:_:) 

Dot product of two vectors

#### Declaration

Swift

public static func * (rhs: Vector, lhs: Vector) -> BigDouble
•  ==(_:_:) 

Equality between vectors

#### Declaration

Swift

public static func == (rhs: Vector, lhs: Vector) -> Bool