Matrix now work on iOS, watchOS and tvOS

Signed-off-by: Arthur Guiot <arguiot@gmail.com>
This commit is contained in:
Arthur Guiot
2020-05-18 17:02:45 -04:00
parent 7510923594
commit bd2ca20729
4 changed files with 5 additions and 3 deletions
+2
View File
@@ -48,10 +48,12 @@ public struct Vector: Equatable {
self.dims = multipleDimensions
self.origin = origin ?? Point(multipleDimensions: Array<BigDouble>(repeating: .zero, count: multipleDimensions.count))
}
#if !os(Linux)
/// Converts a Vector into a Matrix
public var matrix: Matrix {
return Matrix(self.dims.map { $0.asDouble() ?? Double.infinity }, isColumnVector: true)
}
#endif
/// Origin point translated by the vector
public var translated: Point {
let dims = zip(origin.dims, self.dims).map { $0 + $1 }
+1 -1
View File
@@ -4,7 +4,7 @@
//
// Created by Arthur Guiot on 2020-02-07.
//
#if os(macOS)
#if !os(Linux)
import Foundation
import Accelerate
+1 -1
View File
@@ -4,7 +4,7 @@
//
// Created by Arthur Guiot on 2020-02-07.
//
#if os(macOS)
#if !os(Linux)
import Foundation
import Accelerate
+1 -1
View File
@@ -4,7 +4,7 @@
//
// Created by Arthur Guiot on 2020-02-07.
//
#if os(macOS)
#if !os(Linux)
import Foundation
import Accelerate