VectorAdditive
public protocol VectorAdditive : VectorType, AdditiveArithmetic where Self.Scalar : AdditiveArithmetic
Represents a VectorType
with addition and subtraction arithmetic
operators available.
-
nonZeroScalarCount
Default implementationGets the number of scalars within this vector that has a non-zero value.
Default Implementation
Declaration
Swift
var nonZeroScalarCount: Int { get }
-
init()
Default implementationInitializes a zero-valued
VectorType
print(Vector2D()) // Prints "(x: 0.0, y: 0.0)" print(Vector2i()) // Prints "(x: 0, y: 0)"
Default Implementation
Declaration
Swift
init()
-
Declaration
Swift
static func + (lhs: Self, rhs: Self) -> Self
-
Declaration
Swift
static func - (lhs: Self, rhs: Self) -> Self
-
Declaration
Swift
static func + (lhs: Self, rhs: Scalar) -> Self
-
Declaration
Swift
static func - (lhs: Self, rhs: Scalar) -> Self
-
+=(_:
Default implementation_: ) Default Implementation
Declaration
Swift
static func += (lhs: inout Self, rhs: Self)
-
-=(_:
Default implementation_: ) Default Implementation
Declaration
Swift
static func -= (lhs: inout Self, rhs: Self)
-
Declaration
Swift
static func += (lhs: inout Self, rhs: Scalar)
-
Declaration
Swift
static func -= (lhs: inout Self, rhs: Scalar)