Double3
Objective-C
@interface Double3 : NSObject
Swift
class Double3 : NSObject
Simple wrapper for a vector of three double
-
First vector element
Declaration
Objective-C
@property double v0;
Swift
var v0: Double { get set }
-
Second vector element
Declaration
Objective-C
@property double v1;
Swift
var v1: Double { get set }
-
Third vector element
Declaration
Objective-C
@property double v2;
Swift
var v2: Double { get set }
-
Create zero-initialize vecior
Declaration
Objective-C
- (nonnull instancetype)init;
Swift
init()
-
Create vector with specified element values
Declaration
Objective-C
- (nonnull instancetype)initWithV0:(double)v0 v1:(double)v1 v2:(double)v2;
Swift
init(v0: Double, v1: Double, v2: Double)
Parameters
v0
First element
v1
Second element
v2
Third element
-
Create vector with specified element values
Declaration
Objective-C
- (nonnull instancetype)initWithVals:(nonnull NSArray<NSNumber *> *)vals;
Swift
init(vals: [NSNumber])
Parameters
vals
array of element values
-
Update vector with specified element values
Declaration
Objective-C
- (void)set:(nonnull NSArray<NSNumber *> *)vals;
Swift
func set(vals: [NSNumber])
Parameters
vals
array of element values
-
Get vector as an array
Declaration
Objective-C
- (nonnull NSArray<NSNumber *> *)get;
Swift
func get() -> [NSNumber]
-
Compare for equality
Declaration
Objective-C
- (BOOL)isEqual:(nullable id)other;
Swift
func isEqual(_ other: Any?) -> Bool
Parameters
other
Object to compare