Double2
Objective-C
@interface Double2 : NSObject
Swift
class Double2 : NSObject
Simple wrapper for a vector of two 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 }
-
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;
Swift
init(v0: Double, v1: Double)
Parameters
v0
First element
v1
Second 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