Point2d
Objective-C
@interface Point2d : NSObject
Swift
class Point2d : NSObject
Represents a two dimensional point the coordinate values of which are of type double
-
Declaration
Objective-C
@property double xSwift
var x: Double { get set } -
Declaration
Objective-C
@property double ySwift
var y: Double { get set } -
Declaration
Objective-C
- (instancetype)init;Swift
init() -
Declaration
Objective-C
- (instancetype)initWithX:(double)x y:(double)y;Swift
init(x: Double, y: Double) -
Declaration
Objective-C
- (instancetype)initWithVals:(NSArray<NSNumber*>*)vals;Swift
init(vals: [NSNumber]) -
Calculate the dot product of this point and another point
Declaration
Objective-C
- (double)dot:(nonnull Point2d *)point;Swift
func dot(_ point: Point2d) -> DoubleParameters
pointThe other point
-
Set the point coordinates from the values of an array
Declaration
Objective-C
- (void)set:(nonnull NSArray<NSNumber *> *)vals;Swift
func set(vals: [NSNumber])Parameters
valsThe array of values from which to set the coordinates
-
Clone object
Declaration
Objective-C
- (nonnull Point2d *)clone;Swift
func clone() -> Point2d -
Compare for equality
Declaration
Objective-C
- (BOOL)isEqual:(nullable id)other;Swift
func isEqual(_ other: Any?) -> BoolParameters
otherObject to compare
-
Calculate hash value for this object
Declaration
Objective-C
- (NSUInteger)hash;Swift
func hash() -> UInt -
Returns a string that describes the contents of the object
Declaration
Objective-C
- (nonnull NSString *)description;Swift
func description() -> String
View on GitHub
Point2d Class Reference